2013-04-26 12:17:33

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH 0/5] various ab8500 fixes

Hi Samuel,

this series contains various fixes I found on the current -next ab8500
driver(s).

Patches 1 and 2 are just sparse warning, patch 3 drops reference to a
superseeded driver and last two makes ab8500-sysctrl works again without
an explicit ab8500->sysctrl defined, as it is in current kernel.

Thanks,
Fabio


Fabio Baltieri (5):
mfd: abx500-core: fix sparse warning
mfd: ab8500-sysctrl: fix sparse warning
mfd: ab8500: drop references to ab8500-leds
mfd: ab8500-sysctrl: set sysctrl_dev during probe
mfd: ab8500-sysctrl: let sysctrl driver work without pdata

drivers/mfd/ab8500-core.c | 13 -------------
drivers/mfd/ab8500-sysctrl.c | 9 +++++----
drivers/mfd/abx500-core.c | 2 +-
3 files changed, 6 insertions(+), 18 deletions(-)

--
1.8.1.3


2013-04-26 12:17:44

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH 1/5] mfd: abx500-core: fix sparse warning

Fix sparse warning:

drivers/mfd/abx500-core.c:159:38: warning: Using plain integer as NULL pointer

Signed-off-by: Fabio Baltieri <[email protected]>
---
drivers/mfd/abx500-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c
index 9818afb..3714acb 100644
--- a/drivers/mfd/abx500-core.c
+++ b/drivers/mfd/abx500-core.c
@@ -156,7 +156,7 @@ EXPORT_SYMBOL(abx500_startup_irq_enabled);
void abx500_dump_all_banks(void)
{
struct abx500_ops *ops;
- struct device dummy_child = {0};
+ struct device dummy_child = {NULL};
struct abx500_device_entry *dev_entry;

list_for_each_entry(dev_entry, &abx500_list, list) {
--
1.8.1.3

2013-04-26 12:17:55

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH 2/5] mfd: ab8500-sysctrl: fix sparse warning

Fix sparse warning:

drivers/mfd/ab8500-sysctrl.c:26:6: warning: symbol 'ab8500_power_off' was not declared. Should it be static?

Signed-off-by: Fabio Baltieri <[email protected]>
---
drivers/mfd/ab8500-sysctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index fbca1ce..640495e 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -23,7 +23,7 @@

static struct device *sysctrl_dev;

-void ab8500_power_off(void)
+static void ab8500_power_off(void)
{
sigset_t old;
sigset_t all;
--
1.8.1.3

2013-04-26 12:18:07

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH 3/5] mfd: ab8500: drop references to ab8500-leds

The ab8500-leds driver has never been upstreamed and was replaced by a
PWM framework based driver, so these references are not needed anymore.

Signed-off-by: Fabio Baltieri <[email protected]>
---
drivers/mfd/ab8500-core.c | 13 -------------
1 file changed, 13 deletions(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 8e8a016..dd41ae2 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1089,10 +1089,6 @@ static struct mfd_cell ab8500_devs[] = {
.id = 3,
},
{
- .name = "ab8500-leds",
- .of_compatible = "stericsson,ab8500-leds",
- },
- {
.name = "ab8500-denc",
.of_compatible = "stericsson,ab8500-denc",
},
@@ -1161,9 +1157,6 @@ static struct mfd_cell ab9540_devs[] = {
.id = 1,
},
{
- .name = "ab8500-leds",
- },
- {
.name = "abx500-temp",
.num_resources = ARRAY_SIZE(ab8500_temp_resources),
.resources = ab8500_temp_resources,
@@ -1231,9 +1224,6 @@ static struct mfd_cell ab8505_devs[] = {
.id = 1,
},
{
- .name = "ab8500-leds",
- },
- {
.name = "ab8500-gpio",
},
{
@@ -1294,9 +1284,6 @@ static struct mfd_cell ab8540_devs[] = {
.id = 1,
},
{
- .name = "ab8500-leds",
- },
- {
.name = "abx500-temp",
.num_resources = ARRAY_SIZE(ab8500_temp_resources),
.resources = ab8500_temp_resources,
--
1.8.1.3

2013-04-26 12:18:18

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH 4/5] mfd: ab8500-sysctrl: set sysctrl_dev during probe

The driver requires sysctrl_dev to be set at probe, as it's used by
other driver functions. This was dropped by mistake in:

2377e52 mfd: ab8500-sysctrl: Error check clean up

making all driver functions fail.

Signed-off-by: Fabio Baltieri <[email protected]>
---
drivers/mfd/ab8500-sysctrl.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index 640495e..b851692 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -191,6 +191,8 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
if (!(plat && plat->sysctrl))
return -EINVAL;

+ sysctrl_dev = &pdev->dev;
+
if (plat->pm_power_off)
pm_power_off = ab8500_power_off;

--
1.8.1.3

2013-04-26 12:18:26

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH 5/5] 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.
This patch removes the check and let the driver go ahead with probe.

Signed-off-by: Fabio Baltieri <[email protected]>
---
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

2013-05-02 12:34:09

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/5] various ab8500 fixes

On Fri, Apr 26, 2013 at 2:17 PM, Fabio Baltieri
<[email protected]> wrote:

> Hi Samuel,
>
> this series contains various fixes I found on the current -next ab8500
> driver(s).

The series:
Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2013-05-03 08:01:33

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 0/5] various ab8500 fixes

On Fri, 26 Apr 2013, Fabio Baltieri wrote:

> Hi Samuel,
>
> this series contains various fixes I found on the current -next ab8500
> driver(s).
>
> Patches 1 and 2 are just sparse warning, patch 3 drops reference to a
> superseeded driver and last two makes ab8500-sysctrl works again without
> an explicit ab8500->sysctrl defined, as it is in current kernel.
>
> Thanks,
> Fabio
>
>
> Fabio Baltieri (5):
> mfd: abx500-core: fix sparse warning
> mfd: ab8500-sysctrl: fix sparse warning
> mfd: ab8500: drop references to ab8500-leds
> mfd: ab8500-sysctrl: set sysctrl_dev during probe
> mfd: ab8500-sysctrl: let sysctrl driver work without pdata

I have a really petty point:

Try and keep to the $SUBJECT line conventions which are preferred by
each subsystem maintainer. Linus Walleij tends to prefer the scheme
you've used above, but Sam likes the description to start with an
uppercase character. No biggy, I'll just fix that up for you.

> drivers/mfd/ab8500-core.c | 13 -------------
> drivers/mfd/ab8500-sysctrl.c | 9 +++++----
> drivers/mfd/abx500-core.c | 2 +-
> 3 files changed, 6 insertions(+), 18 deletions(-)

All patches applied. Thanks Fabio.

--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog