Commit a0ef6db7 authored by Fabio Estevam's avatar Fabio Estevam Committed by Jonathan Cameron

iio: mxs-lradc: Fix the order of resources removal

Fix the order of resources removal in the error path of mxs_lradc_probe()
and also in mxs_lradc_remove().
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Acked-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent e5e26dd5
...@@ -987,7 +987,7 @@ static int mxs_lradc_probe(struct platform_device *pdev) ...@@ -987,7 +987,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
/* Register the touchscreen input device. */ /* Register the touchscreen input device. */
ret = mxs_lradc_ts_register(lradc); ret = mxs_lradc_ts_register(lradc);
if (ret) if (ret)
goto err_dev; goto err_ts_register;
/* Register IIO device. */ /* Register IIO device. */
ret = iio_device_register(iio); ret = iio_device_register(iio);
...@@ -1000,6 +1000,8 @@ static int mxs_lradc_probe(struct platform_device *pdev) ...@@ -1000,6 +1000,8 @@ static int mxs_lradc_probe(struct platform_device *pdev)
err_ts: err_ts:
mxs_lradc_ts_unregister(lradc); mxs_lradc_ts_unregister(lradc);
err_ts_register:
mxs_lradc_hw_stop(lradc);
err_dev: err_dev:
mxs_lradc_trigger_remove(iio); mxs_lradc_trigger_remove(iio);
err_trig: err_trig:
...@@ -1012,13 +1014,11 @@ static int mxs_lradc_remove(struct platform_device *pdev) ...@@ -1012,13 +1014,11 @@ static int mxs_lradc_remove(struct platform_device *pdev)
struct iio_dev *iio = platform_get_drvdata(pdev); struct iio_dev *iio = platform_get_drvdata(pdev);
struct mxs_lradc *lradc = iio_priv(iio); struct mxs_lradc *lradc = iio_priv(iio);
iio_device_unregister(iio);
mxs_lradc_ts_unregister(lradc); mxs_lradc_ts_unregister(lradc);
mxs_lradc_hw_stop(lradc); mxs_lradc_hw_stop(lradc);
iio_device_unregister(iio);
iio_triggered_buffer_cleanup(iio);
mxs_lradc_trigger_remove(iio); mxs_lradc_trigger_remove(iio);
iio_triggered_buffer_cleanup(iio);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment