linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: ab8500-sysctrl: Always enable pm_power_off handler
@ 2013-05-09 11:08 Fabio Baltieri
  2013-05-13 10:44 ` Lee Jones
  2013-05-14  8:49 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Baltieri @ 2013-05-09 11:08 UTC (permalink / raw)
  To: linux-arm-kernel

AB8500 sysctrl driver implements a pm_power_off handler, but that is
currently not registered until a specific platform data field is
enabled.

This patch drops the platform data field and always registers
ab8500_power_off if no other pm_power_off handler was defined before,
and also introduces the necessary cleanup code in the driver's remove
function.

Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---
 drivers/mfd/ab8500-sysctrl.c      | 6 +++++-
 include/linux/mfd/abx500/ab8500.h | 2 --
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index eadae4d..8e0dae5 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -193,7 +193,7 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
 
 	sysctrl_dev = &pdev->dev;
 
-	if (plat->pm_power_off)
+	if (!pm_power_off)
 		pm_power_off = ab8500_power_off;
 
 	pdata = plat->sysctrl;
@@ -227,6 +227,10 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
 static int ab8500_sysctrl_remove(struct platform_device *pdev)
 {
 	sysctrl_dev = NULL;
+
+	if (pm_power_off == ab8500_power_off)
+		pm_power_off = NULL;
+
 	return 0;
 }
 
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index b5780fd..6c119b5 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -374,7 +374,6 @@ struct ab8500_sysctrl_platform_data;
 /**
  * struct ab8500_platform_data - AB8500 platform data
  * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used
- * @pm_power_off: Should machine pm power off hook be registered or not
  * @init: board-specific initialization after detection of ab8500
  * @num_regulator_reg_init: number of regulator init registers
  * @regulator_reg_init: regulator init registers
@@ -383,7 +382,6 @@ struct ab8500_sysctrl_platform_data;
  */
 struct ab8500_platform_data {
 	int irq_base;
-	bool pm_power_off;
 	void (*init) (struct ab8500 *);
 	int num_regulator_reg_init;
 	struct ab8500_regulator_reg_init *regulator_reg_init;
-- 
1.8.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] mfd: ab8500-sysctrl: Always enable pm_power_off handler
  2013-05-09 11:08 [PATCH] mfd: ab8500-sysctrl: Always enable pm_power_off handler Fabio Baltieri
@ 2013-05-13 10:44 ` Lee Jones
  2013-05-14  8:49 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2013-05-13 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 09 May 2013, Fabio Baltieri wrote:

> AB8500 sysctrl driver implements a pm_power_off handler, but that is
> currently not registered until a specific platform data field is
> enabled.
> 
> This patch drops the platform data field and always registers
> ab8500_power_off if no other pm_power_off handler was defined before,
> and also introduces the necessary cleanup code in the driver's remove
> function.
> 
> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
> ---
>  drivers/mfd/ab8500-sysctrl.c      | 6 +++++-
>  include/linux/mfd/abx500/ab8500.h | 2 --
>  2 files changed, 5 insertions(+), 3 deletions(-)

The code looks good to me, but I'd like Linus' or Mattias' Ack before
I apply it.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] mfd: ab8500-sysctrl: Always enable pm_power_off handler
  2013-05-09 11:08 [PATCH] mfd: ab8500-sysctrl: Always enable pm_power_off handler Fabio Baltieri
  2013-05-13 10:44 ` Lee Jones
@ 2013-05-14  8:49 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-05-14  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 9, 2013 at 1:08 PM, Fabio Baltieri
<fabio.baltieri@linaro.org> wrote:

> AB8500 sysctrl driver implements a pm_power_off handler, but that is
> currently not registered until a specific platform data field is
> enabled.
>
> This patch drops the platform data field and always registers
> ab8500_power_off if no other pm_power_off handler was defined before,
> and also introduces the necessary cleanup code in the driver's remove
> function.
>
> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-14  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 11:08 [PATCH] mfd: ab8500-sysctrl: Always enable pm_power_off handler Fabio Baltieri
2013-05-13 10:44 ` Lee Jones
2013-05-14  8:49 ` Linus Walleij

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).