diff mbox series

[09/10] Input: lpc32xx_ts - stop_tsc when driver remove

Message ID 20230705052346.39337-9-frank.li@vivo.com (mailing list archive)
State New, archived
Headers show
Series [01/10] Input: bcm-keypad - Convert to devm_platform_ioremap_resource() | expand

Commit Message

Yangtao Li July 5, 2023, 5:23 a.m. UTC
When the driver is removed, we need to close the device.

Fixes: 3045a5f5202a ("Input: add LPC32xx touchscreen controller driver")
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/input/touchscreen/lpc32xx_ts.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Dmitry Torokhov July 11, 2023, 12:40 a.m. UTC | #1
Hi,

On Wed, Jul 05, 2023 at 01:23:45PM +0800, Yangtao Li wrote:
> When the driver is removed, we need to close the device.
> 
> Fixes: 3045a5f5202a ("Input: add LPC32xx touchscreen controller driver")
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/input/touchscreen/lpc32xx_ts.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c
> index 15b5cb763526..ffdd748a9992 100644
> --- a/drivers/input/touchscreen/lpc32xx_ts.c
> +++ b/drivers/input/touchscreen/lpc32xx_ts.c
> @@ -305,6 +305,8 @@ static int lpc32xx_ts_remove(struct platform_device *pdev)
>  	struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev);
>  	struct resource *res;
>  
> +	lpc32xx_stop_tsc(tsc);
> +

This change is not needed because lpc32xx_stop_tsc() is already being
called from lpc32xx_ts_close() which is called when we unregister input
device (provided that open() was called earlier).

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c
index 15b5cb763526..ffdd748a9992 100644
--- a/drivers/input/touchscreen/lpc32xx_ts.c
+++ b/drivers/input/touchscreen/lpc32xx_ts.c
@@ -305,6 +305,8 @@  static int lpc32xx_ts_remove(struct platform_device *pdev)
 	struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev);
 	struct resource *res;
 
+	lpc32xx_stop_tsc(tsc);
+
 	free_irq(tsc->irq, tsc);
 
 	input_unregister_device(tsc->dev);