Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b8ebdb1 authored by Fabio Baltieri's avatar Fabio Baltieri Committed by Samuel Ortiz
Browse files

mfd: ab8500-sysctrl: Always enable pm_power_off handler



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.

Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarFabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 955de2ea
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;
@@ -228,6 +228,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;
}

+0 −2
Original line number Diff line number Diff line
@@ -373,13 +373,11 @@ 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
 * @regulator: machine-specific constraints for regulators
 */
struct ab8500_platform_data {
	int irq_base;
	bool pm_power_off;
	void (*init) (struct ab8500 *);
	struct ab8500_regulator_platform_data *regulator;
	struct abx500_gpio_platform_data *gpio;