linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: mxs-lradc: Fix the order of resources removal
@ 2013-09-03  0:48 Fabio Estevam
  2013-09-03  0:48 ` [PATCH 2/2] iio: mxs-lradc: Add MODULE_ALIAS Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Fabio Estevam @ 2013-09-03  0:48 UTC (permalink / raw)
  To: jic23; +Cc: marex, linux-iio, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Fix the order of resources removal in the error path of mxs_lradc_probe()
and also in mxs_lradc_remove().

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/staging/iio/adc/mxs-lradc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index a08c173..75f5aac 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -987,7 +987,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
 	/* Register the touchscreen input device. */
 	ret = mxs_lradc_ts_register(lradc);
 	if (ret)
-		goto err_dev;
+		goto err_ts_register;
 
 	/* Register IIO device. */
 	ret = iio_device_register(iio);
@@ -1000,6 +1000,8 @@ static int mxs_lradc_probe(struct platform_device *pdev)
 
 err_ts:
 	mxs_lradc_ts_unregister(lradc);
+err_ts_register:
+	mxs_lradc_hw_stop(lradc);
 err_dev:
 	mxs_lradc_trigger_remove(iio);
 err_trig:
@@ -1012,13 +1014,11 @@ static int mxs_lradc_remove(struct platform_device *pdev)
 	struct iio_dev *iio = platform_get_drvdata(pdev);
 	struct mxs_lradc *lradc = iio_priv(iio);
 
+	iio_device_unregister(iio);
 	mxs_lradc_ts_unregister(lradc);
-
 	mxs_lradc_hw_stop(lradc);
-
-	iio_device_unregister(iio);
-	iio_triggered_buffer_cleanup(iio);
 	mxs_lradc_trigger_remove(iio);
+	iio_triggered_buffer_cleanup(iio);
 
 	return 0;
 }
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-09-08 18:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03  0:48 [PATCH 1/2] iio: mxs-lradc: Fix the order of resources removal Fabio Estevam
2013-09-03  0:48 ` [PATCH 2/2] iio: mxs-lradc: Add MODULE_ALIAS Fabio Estevam
2013-09-03  0:59   ` Marek Vasut
2013-09-08 14:31     ` Jonathan Cameron
2013-09-08 14:52       ` Fabio Estevam
2013-09-08 15:00         ` Marek Vasut
2013-09-08 15:33           ` Jonathan Cameron
2013-09-08 16:11             ` Marek Vasut
2013-09-08 17:03               ` Jonathan Cameron
2013-09-08 18:47                 ` Fabio Estevam
2013-09-03  1:00 ` [PATCH 1/2] iio: mxs-lradc: Fix the order of resources removal Marek Vasut
2013-09-08 14:29 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).