[PATCH] iio: adc: aspeed: propagate reset deassert errors

Pengpeng Hou posted 1 patch 3 weeks, 6 days ago
drivers/iio/adc/aspeed_adc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH] iio: adc: aspeed: propagate reset deassert errors
Posted by Pengpeng Hou 3 weeks, 6 days ago
aspeed_adc_probe() continues to register ADC resources after deasserting
the shared reset, even if the reset controller reports a failure.

A failed deassertion leaves the hardware unavailable, so stop probing
before
installing the cleanup action and enabling the ADC.

Fixes: edf7550a1f93 ("iio: adc: aspeed: Deassert reset in probe")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/iio/adc/aspeed_adc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index 6169ce28261e1..452c30cf04f28 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -585,7 +585,9 @@ static int aspeed_adc_probe(struct platform_device *pdev)
 		return dev_err_probe(dev, PTR_ERR(data->rst),
 				     "invalid or missing reset controller device tree entry");
 
-	reset_control_deassert(data->rst);
+	ret = reset_control_deassert(data->rst);
+	if (ret)
+		return ret;
 
 	ret = devm_add_action_or_reset(dev, aspeed_adc_reset_assert, data->rst);
 	if (ret)

base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
-- 
2.50.1
Re: [PATCH] iio: adc: aspeed: propagate reset deassert errors
Posted by Jonathan Cameron 3 weeks, 6 days ago
> aspeed_adc_probe() continues to register ADC resources after deasserting
> the shared reset, even if the reset controller reports a failure.
> 
> A failed deassertion leaves the hardware unavailable, so stop probing
> before
> installing the cleanup action and enabling the ADC.
Something odd happened here with the line wrap.

Otherwise, this one looks 'obvious' enough that I'll pick it up
now and apply it to the fixes-togreg branch of iio.git.

Note I'll be rebasing that on rc1 once it becomes available.

Thanks,

Jonathan

-- 
Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>