diff mbox series

Input: mxs-lradc-ts - execute mxs_lradc_ts_stop() only once

Message ID 20200617000349.7429-1-festevam@gmail.com
State New
Headers show
Series Input: mxs-lradc-ts - execute mxs_lradc_ts_stop() only once | expand

Commit Message

Fabio Estevam June 17, 2020, 12:03 a.m. UTC
Currently mxs_lradc_ts_stop() is unnecessarily executed several times
as it is placed inside a for loop.

Executing it only once is enough, so move it outside the for loop.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/input/touchscreen/mxs-lradc-ts.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index 9e36fee38d61..d42203b14335 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -669,6 +669,7 @@  static int mxs_lradc_ts_probe(struct platform_device *pdev)
 		return ret;
 
 	mxs_lradc_ts_hw_init(ts);
+	mxs_lradc_ts_stop(ts);
 
 	for (i = 0; i < 3; i++) {
 		irq = platform_get_irq_byname(pdev, mxs_lradc_ts_irq_names[i]);
@@ -677,8 +678,6 @@  static int mxs_lradc_ts_probe(struct platform_device *pdev)
 
 		virq = irq_of_parse_and_map(node, irq);
 
-		mxs_lradc_ts_stop(ts);
-
 		ret = devm_request_irq(dev, virq,
 				       mxs_lradc_ts_handle_irq,
 				       0, mxs_lradc_ts_irq_names[i], ts);