Commit a4780db3 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

pps: clients: gpio: Bail out on error when requesting GPIO echo line

When requesting optional GPIO echo line, bail out on error,
so user will know that something wrong with the existing property.
Acked-by: default avatarRodolfo Giometti <giometti@enneenne.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210318130321.24227-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae28c1be
......@@ -119,12 +119,12 @@ static int pps_gpio_setup(struct platform_device *pdev)
data->echo_pin = devm_gpiod_get_optional(&pdev->dev,
"echo",
GPIOD_OUT_LOW);
if (data->echo_pin) {
if (IS_ERR(data->echo_pin)) {
dev_err(&pdev->dev, "failed to request ECHO GPIO\n");
return PTR_ERR(data->echo_pin);
}
if (IS_ERR(data->echo_pin)) {
dev_err(&pdev->dev, "failed to request ECHO GPIO\n");
return PTR_ERR(data->echo_pin);
}
if (data->echo_pin) {
ret = of_property_read_u32(np,
"echo-active-ms",
&value);
......
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