Skip to content

Commit 5649d8f

Browse files
fabiobaltieriSamuel Ortiz
authored andcommitted
mfd: ab8500-sysctrl: Let sysctrl driver work without pdata
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, and enforcing it breaks existing platforms for no reason. This patch removes the check and let the driver go ahead with probe. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent e9d7b4b commit 5649d8f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎drivers/mfd/ab8500-sysctrl.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void ab8500_restart(char mode, const char *cmd)
104104

105105
plat = dev_get_platdata(sysctrl_dev->parent);
106106
pdata = plat->sysctrl;
107-
if (pdata->reboot_reason_code)
107+
if (pdata && pdata->reboot_reason_code)
108108
reason = pdata->reboot_reason_code(cmd);
109109
else
110110
pr_warn("[%s] No reboot reason set. Default reason %d\n",
@@ -188,7 +188,7 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
188188

189189
plat = dev_get_platdata(pdev->dev.parent);
190190

191-
if (!(plat && plat->sysctrl))
191+
if (!plat)
192192
return -EINVAL;
193193

194194
sysctrl_dev = &pdev->dev;
@@ -197,7 +197,6 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
197197
pm_power_off = ab8500_power_off;
198198

199199
pdata = plat->sysctrl;
200-
201200
if (pdata) {
202201
int last, ret, i, j;
203202

0 commit comments

Comments
 (0)