lkml.org 
[lkml]   [2012]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] Add a core driver for SI476x MFD
On Thu, Sep 13, 2012 at 03:40:11PM -0700, Andrey Smirnov wrote:

> + core = kzalloc(sizeof(*core), GFP_KERNEL);

devm_kzalloc()

> + if (!core) {
> + pr_err("si476x-core: failed to allocate " \
> + "'struct si476x_core'\n");
> + return -ENOMEM;
> + }

Splitting error messages over multiple lines like this just makes things
hard to grep for.

> + core->supplies.vio1 = regulator_get(&client->dev, "vio1");
> + if (IS_ERR_OR_NULL(core->supplies.vio1)) {
> + dev_info(&client->dev, "No vio1 regulator found\n");
> + core->supplies.vio1 = NULL;
> + }

This and all the usages of the regulator API in the driver are broken,
the driver should treat failures to get the supplies as errors. There
are more than enough ways to stub things out in the core.


\
 
 \ /
  Last update: 2012-10-02 22:41    [W:0.216 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site