From: Axel Lin <axel.lin@ingics.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: Harald Welte <laforge@openmoko.org>,
Lars-Peter Clausen <lars@metafoo.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH] mfd: pcf50633: Init pcf->dev before using it
Date: Tue, 25 Dec 2012 10:52:49 +0800 [thread overview]
Message-ID: <1356403969.22368.1.camel@phoenix> (raw)
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
next reply other threads:[~2012-12-25 2:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-25 2:52 Axel Lin [this message]
2013-01-22 3:31 ` [PATCH] mfd: pcf50633: Init pcf->dev before using it Samuel Ortiz
[not found] ` <CAFRkauDQD4bA2VwrWVfzBcwY-A7y4VzQam8tB4L5HGNOS48uGA@mail.gmail.com>
2013-01-27 0:32 ` Samuel Ortiz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356403969.22368.1.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=laforge@openmoko.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox