lkml.org 
[lkml]   [2020]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/24] Input: gpio_keys - Simplify with dev_err_probe()
On Wed, Aug 26, 2020 at 08:16:44PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.

> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -505,10 +505,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
> */
> bdata->gpiod = NULL;

gpiod_get_optional()?
Do not see much context though (but please double check your series for these
kind of things).

> } else {
> - if (error != -EPROBE_DEFER)
> - dev_err(dev, "failed to get gpio: %d\n",
> - error);
> - return error;
> + return dev_err_probe(dev, error, "failed to get gpio\n");
> }
> }
> } else if (gpio_is_valid(button->gpio)) {

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2020-08-26 21:14    [W:0.288 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site