Message ID | 20200826181706.11098-2-krzk@kernel.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index f2d4e4daa818..6f670cbe8a8b 100644 --- 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; } 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)) {
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- drivers/input/keyboard/gpio_keys.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)