From: fabio.baltieri@linaro.org (Fabio Baltieri)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] mfd: ab8500-sysctrl: let sysctrl driver work without pdata
Date: Fri, 26 Apr 2013 14:17:18 +0200 [thread overview]
Message-ID: <1366978638-967-6-git-send-email-fabio.baltieri@linaro.org> (raw)
In-Reply-To: <1366978638-967-1-git-send-email-fabio.baltieri@linaro.org>
A check for a valid plat->sysctrl was introduced in:
2377e52 mfd: ab8500-sysctrl: Error check clean up
but the driver works just fine even without that initialization data.
This patch removes the check and let the driver go ahead with probe.
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---
drivers/mfd/ab8500-sysctrl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index b851692..eadae4d 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -104,7 +104,7 @@ void ab8500_restart(char mode, const char *cmd)
plat = dev_get_platdata(sysctrl_dev->parent);
pdata = plat->sysctrl;
- if (pdata->reboot_reason_code)
+ if (pdata && pdata->reboot_reason_code)
reason = pdata->reboot_reason_code(cmd);
else
pr_warn("[%s] No reboot reason set. Default reason %d\n",
@@ -188,7 +188,7 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
plat = dev_get_platdata(pdev->dev.parent);
- if (!(plat && plat->sysctrl))
+ if (!plat)
return -EINVAL;
sysctrl_dev = &pdev->dev;
@@ -197,7 +197,6 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
pm_power_off = ab8500_power_off;
pdata = plat->sysctrl;
-
if (pdata) {
int last, ret, i, j;
--
1.8.1.3
next prev parent reply other threads:[~2013-04-26 12:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 12:17 [PATCH 0/5] various ab8500 fixes Fabio Baltieri
2013-04-26 12:17 ` [PATCH 1/5] mfd: abx500-core: fix sparse warning Fabio Baltieri
2013-04-26 12:17 ` [PATCH 2/5] mfd: ab8500-sysctrl: " Fabio Baltieri
2013-04-26 12:17 ` [PATCH 3/5] mfd: ab8500: drop references to ab8500-leds Fabio Baltieri
2013-04-26 12:17 ` [PATCH 4/5] mfd: ab8500-sysctrl: set sysctrl_dev during probe Fabio Baltieri
2013-04-26 12:17 ` Fabio Baltieri [this message]
2013-05-02 12:34 ` [PATCH 0/5] various ab8500 fixes Linus Walleij
2013-05-03 8:01 ` Lee Jones
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=1366978638-967-6-git-send-email-fabio.baltieri@linaro.org \
--to=fabio.baltieri@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).