pps: clients: gpio: Remove redundant condition in ->remove()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 18 Mar 2021 13:03:17 +0000 (15:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Mar 2021 07:26:31 +0000 (08:26 +0100)
The timer along with GPIO API are NULL-aware, there is no need to test
against existing GPIO echo line.

Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210318130321.24227-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pps/clients/pps-gpio.c

index 78c9680..dc9ed6f 100644 (file)
@@ -240,11 +240,9 @@ static int pps_gpio_remove(struct platform_device *pdev)
        struct pps_gpio_device_data *data = platform_get_drvdata(pdev);
 
        pps_unregister_source(data->pps);
-       if (data->echo_pin) {
-               del_timer_sync(&data->echo_timer);
-               /* reset echo pin in any case */
-               gpiod_set_value(data->echo_pin, 0);
-       }
+       del_timer_sync(&data->echo_timer);
+       /* reset echo pin in any case */
+       gpiod_set_value(data->echo_pin, 0);
        dev_info(&pdev->dev, "removed IRQ %d as PPS source\n", data->irq);
        return 0;
 }