mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
Input: silead - simplify with dev_err_probe()
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 <krzysztof.kozlowski@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230625162817.100397-19-krzysztof.kozlowski@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
17d981fa70
commit
21142c1cb2
1 changed files with 3 additions and 5 deletions
|
@ -706,11 +706,9 @@ static int silead_ts_probe(struct i2c_client *client)
|
|||
|
||||
/* Power GPIO pin */
|
||||
data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
|
||||
if (IS_ERR(data->gpio_power)) {
|
||||
if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER)
|
||||
dev_err(dev, "Shutdown GPIO request failed\n");
|
||||
return PTR_ERR(data->gpio_power);
|
||||
}
|
||||
if (IS_ERR(data->gpio_power))
|
||||
return dev_err_probe(dev, PTR_ERR(data->gpio_power),
|
||||
"Shutdown GPIO request failed\n");
|
||||
|
||||
error = silead_ts_setup(client);
|
||||
if (error)
|
||||
|
|
Loading…
Add table
Reference in a new issue