Thread (16 messages) 16 messages, 3 authors, 2012-02-10
STALE5227d

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

From: Uwe Kleine-König <hidden>
Date: 2012-01-30 07:27:56

On Mon, Jan 30, 2012 at 09:33:26AM +1100, Marc Reilly wrote:
Requesting a conversion for and invalid mode would mean that the
s/and/an/
quoted hunk ↗ jump to hunk
MC13XXX_ADC_WORKING flag never gets cleared.

Signed-off-by: Marc Reilly <redacted>
---
 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;
I would prefer this to be named in a more descritive way. Maybe
"out_clear_working"?

Other than that, ack.

Uwe
quoted hunk ↗ jump to hunk
 	}
 
 	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
-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help