[PATCH 4/6] mfd: mc13xxx-core: ADC conv: clear ADC_WORKING flag for invalid mode

Marc Reilly marc at cpdesign.com.au
Sun Jan 29 17:33:26 EST 2012


Requesting a conversion for and invalid mode would mean that the
MC13XXX_ADC_WORKING flag never gets cleared.

Signed-off-by: Marc Reilly <marc at cpdesign.com.au>
---
 drivers/mfd/mc13xxx-core.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 56e09ea..61a767d 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -557,8 +557,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
 		break;
 
 	default:
-		mc13xxx_unlock(mc13xxx);
-		return -EINVAL;
+		dev_warn(mc13xxx->dev, "%s: bad ADC mode requested\n", __func__);
+		ret = -EINVAL;
+		goto out_flag;
 	}
 
 	dev_dbg(mc13xxx->dev, "%s: request irq\n", __func__);
@@ -608,6 +609,7 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
 		/* restore TSMOD */
 		mc13xxx_reg_write(mc13xxx, MC13XXX_ADC0, old_adc0);
 
+out_flag:
 	mc13xxx->adcflags &= ~MC13XXX_ADC_WORKING;
 out:
 	mc13xxx_unlock(mc13xxx);
-- 
1.7.3.4




More information about the linux-arm-kernel mailing list