public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: pcf50633: Init pcf->dev before using it
@ 2012-12-25  2:52 Axel Lin
  2013-01-22  3:31 ` Samuel Ortiz
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2012-12-25  2:52 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Harald Welte, Lars-Peter Clausen, linux-kernel

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

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mfd/pcf50633-core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 64803f1..d115673 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -208,6 +208,8 @@ static int pcf50633_probe(struct i2c_client *client,
 	if (!pcf)
 		return -ENOMEM;
 
+	i2c_set_clientdata(client, pcf);
+	pcf->dev = &client->dev;
 	pcf->pdata = pdata;
 
 	mutex_init(&pcf->lock);
@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	i2c_set_clientdata(client, pcf);
-	pcf->dev = &client->dev;
-
 	version = pcf50633_reg_read(pcf, 0);
 	variant = pcf50633_reg_read(pcf, 1);
 	if (version < 0 || variant < 0) {
-- 
1.7.9.5




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

end of thread, other threads:[~2013-01-27  0:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-25  2:52 [PATCH] mfd: pcf50633: Init pcf->dev before using it Axel Lin
2013-01-22  3:31 ` Samuel Ortiz
     [not found]   ` <CAFRkauDQD4bA2VwrWVfzBcwY-A7y4VzQam8tB4L5HGNOS48uGA@mail.gmail.com>
2013-01-27  0:32     ` Samuel Ortiz

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