Re: [PATCH resend v1 3/7] pps: clients: gpio: Remove redundant condition in ->remove()

2021-03-09 Thread Rodolfo Giometti
On 09/03/21 12:23, Andy Shevchenko wrote:
> The timer along with GPIO API are NULL-aware, there is no need to test
> against existing GPIO echo line.
> 
> Signed-off-by: Andy Shevchenko 
> ---
>  drivers/pps/clients/pps-gpio.c | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
> index 78c9680e8063..dc9ed6fc3dae 100644
> --- a/drivers/pps/clients/pps-gpio.c
> +++ b/drivers/pps/clients/pps-gpio.c
> @@ -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(>echo_timer);
> - /* reset echo pin in any case */
> - gpiod_set_value(data->echo_pin, 0);
> - }
> + del_timer_sync(>echo_timer);
> + /* reset echo pin in any case */
> + gpiod_set_value(data->echo_pin, 0);
>   dev_info(>dev, "removed IRQ %d as PPS source\n", data->irq);
>   return 0;
>  }
> 

Acked-by: Rodolfo Giometti 

-- 
GNU/Linux Solutions  e-mail: giome...@enneenne.com
Linux Device Driver  giome...@linux.it
Embedded Systems phone:  +39 349 2432127
UNIX programming skype:  rodolfo.giometti


[PATCH resend v1 3/7] pps: clients: gpio: Remove redundant condition in ->remove()

2021-03-09 Thread Andy Shevchenko
The timer along with GPIO API are NULL-aware, there is no need to test
against existing GPIO echo line.

Signed-off-by: Andy Shevchenko 
---
 drivers/pps/clients/pps-gpio.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index 78c9680e8063..dc9ed6fc3dae 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -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(>echo_timer);
-   /* reset echo pin in any case */
-   gpiod_set_value(data->echo_pin, 0);
-   }
+   del_timer_sync(>echo_timer);
+   /* reset echo pin in any case */
+   gpiod_set_value(data->echo_pin, 0);
dev_info(>dev, "removed IRQ %d as PPS source\n", data->irq);
return 0;
 }
-- 
2.30.1