lkml.org 
[lkml]   [2020]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 09/24] Input: bu21013_ts - Simplify with dev_err_probe()
On Wed, Aug 26, 2020 at 9:19 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.

> ts->cs_gpiod = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
> error = PTR_ERR_OR_ZERO(ts->cs_gpiod);

> + if (error)
> + return dev_err_probe(&client->dev, error, "failed to get CS GPIO\n");
> +

if (IS_ERR())
return ... PTR_ERR()...


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-08-27 11:12    [W:0.322 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site