lkml.org 
[lkml]   [2018]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/3] drivers: use probe_err function in obvious cases
On Tue, Oct 16, 2018 at 10:22 AM Andrzej Hajda <a.hajda@samsung.com> wrote:
>
> The patch replaces obviously matching code with probe_err function.
> There are many more places where probe_err could be used.
> The patch shows how the new function should be used, and how it
> improves the code.

> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -824,9 +824,7 @@ static int pca953x_probe(struct i2c_client *client,
> reg = devm_regulator_get(&client->dev, "vcc");
> if (IS_ERR(reg)) {
> ret = PTR_ERR(reg);
> - if (ret != -EPROBE_DEFER)
> - dev_err(&client->dev, "reg get err: %d\n", ret);
> - return ret;
> + return probe_err(&client->dev, ret, "reg get err: %d\n", ret);

No need to assign ret above.
As I mentioned, better to print a value for everyone.

> }

Please, split it at least one patch per subsystem.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-10-16 15:53    [W:0.154 / U:31.212 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site