public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: max77686: Init max77686->dev before using it
@ 2012-12-24 16:16 Axel Lin
  2012-12-24 16:28 ` [PATCH 2/2] mfd: max77693: Init max77693->dev " Axel Lin
  2013-01-22  3:24 ` [PATCH 1/2] mfd: max77686: Init max77686->dev " Samuel Ortiz
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2012-12-24 16:16 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Chiwoong Byun, Jonghwa Lee, Myungjoo Ham, Kyungmin Park,
	linux-kernel

Current code uses max77686->dev in the dev_err call before setting it to
&i2c->dev. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mfd/max77686.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index f6878f8..4d73963 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -93,15 +93,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
 	if (max77686 == NULL)
 		return -ENOMEM;
 
-	max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
-	if (IS_ERR(max77686->regmap)) {
-		ret = PTR_ERR(max77686->regmap);
-		dev_err(max77686->dev, "Failed to allocate register map: %d\n",
-				ret);
-		kfree(max77686);
-		return ret;
-	}
-
 	i2c_set_clientdata(i2c, max77686);
 	max77686->dev = &i2c->dev;
 	max77686->i2c = i2c;
@@ -111,6 +102,15 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
 	max77686->irq_gpio = pdata->irq_gpio;
 	max77686->irq = i2c->irq;
 
+	max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
+	if (IS_ERR(max77686->regmap)) {
+		ret = PTR_ERR(max77686->regmap);
+		dev_err(max77686->dev, "Failed to allocate register map: %d\n",
+				ret);
+		kfree(max77686);
+		return ret;
+	}
+
 	if (regmap_read(max77686->regmap,
 			 MAX77686_REG_DEVICE_ID, &data) < 0) {
 		dev_err(max77686->dev,
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-22  3:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-24 16:16 [PATCH 1/2] mfd: max77686: Init max77686->dev before using it Axel Lin
2012-12-24 16:28 ` [PATCH 2/2] mfd: max77693: Init max77693->dev " Axel Lin
2013-01-22  3:30   ` Samuel Ortiz
2013-01-22  3:24 ` [PATCH 1/2] mfd: max77686: Init max77686->dev " Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox