From: Dan Carpenter <error27@gmail.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Bengt JONSSON <bengt.g.jonsson@stericsson.com>,
Sundar R Iyer <sundar.iyer@stericsson.com>,
Linus Walleij <linus.walleij@stericsson.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] regulator/ab8500: move dereference below the check for NULL
Date: Sat, 14 Aug 2010 09:03:16 +0000 [thread overview]
Message-ID: <20100814090316.GX645@bicker> (raw)
I moved the dereference of "ab8500" below the check for NULL.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index dc3f1a4..cc7cbaf 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -344,13 +344,14 @@ static inline struct ab8500_regulator_info *find_regulator_info(int id)
static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
{
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
- struct ab8500_platform_data *pdata = dev_get_platdata(ab8500->dev);
+ struct ab8500_platform_data *pdata;
int i, err;
if (!ab8500) {
dev_err(&pdev->dev, "null mfd parent\n");
return -EINVAL;
}
+ pdata = dev_get_platdata(ab8500->dev);
/* register all regulators */
for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Bengt JONSSON <bengt.g.jonsson@stericsson.com>,
Sundar R Iyer <sundar.iyer@stericsson.com>,
Linus Walleij <linus.walleij@stericsson.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] regulator/ab8500: move dereference below the check for NULL
Date: Sat, 14 Aug 2010 11:03:16 +0200 [thread overview]
Message-ID: <20100814090316.GX645@bicker> (raw)
I moved the dereference of "ab8500" below the check for NULL.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index dc3f1a4..cc7cbaf 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -344,13 +344,14 @@ static inline struct ab8500_regulator_info *find_regulator_info(int id)
static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
{
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
- struct ab8500_platform_data *pdata = dev_get_platdata(ab8500->dev);
+ struct ab8500_platform_data *pdata;
int i, err;
if (!ab8500) {
dev_err(&pdev->dev, "null mfd parent\n");
return -EINVAL;
}
+ pdata = dev_get_platdata(ab8500->dev);
/* register all regulators */
for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
next reply other threads:[~2010-08-14 9:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-14 9:03 Dan Carpenter [this message]
2010-08-14 9:03 ` [patch] regulator/ab8500: move dereference below the check for NULL Dan Carpenter
2010-08-14 9:36 ` Mark Brown
2010-08-14 9:36 ` Mark Brown
2010-08-14 9:57 ` Sundar R IYER
2010-08-14 10:09 ` [patch] regulator/ab8500: move dereference below the check for Sundar R IYER
2010-08-14 11:15 ` Liam Girdwood
2010-08-14 11:15 ` [patch] regulator/ab8500: move dereference below the check for NULL Liam Girdwood
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=20100814090316.GX645@bicker \
--to=error27@gmail.com \
--cc=bengt.g.jonsson@stericsson.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=sundar.iyer@stericsson.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.