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

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

From: Marc Reilly <hidden>
Date: 2012-01-29 22:33:26
Subsystem: multifunction devices (mfd), the rest · Maintainers: Lee Jones, Linus Torvalds

Requesting a conversion for and invalid mode would mean that the
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;
 	}
 
 	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help