Commit 21142c1c authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Dmitry Torokhov

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-19-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 17d981fa
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment