Skip to content

Commit

Permalink
pps: clients: gpio: Bail out on error when requesting GPIO echo line
Browse files Browse the repository at this point in the history
When requesting optional GPIO echo line, bail out on error,
so user will know that something wrong with the existing property.

Acked-by: Rodolfo Giometti <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
andy-shev authored and gregkh committed Mar 24, 2021
1 parent ae28c1b commit a4780db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/pps/clients/pps-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a4780db

Please sign in to comment.