mfd: palmas: Reset pm_power_off if it is set for the device
authorLaxman Dewangan <ldewangan@nvidia.com>
Thu, 26 Sep 2013 13:33:50 +0000 (19:03 +0530)
committerLee Jones <lee.jones@linaro.org>
Wed, 23 Oct 2013 15:21:36 +0000 (16:21 +0100)
If Palams supports the system power controller and pm_power_off
is implemented through the Palmas driver then reset the pm_power_off
in driver remove.

This will avoid the call of Palmas driver after removal of driver.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/palmas.c

index 3b63139fe563761f95f27250a1937d8659c8c66e..6aab016f4c37e1b1feb9e3b174d10a2cc649b76e 100644 (file)
@@ -570,6 +570,11 @@ static int palmas_i2c_remove(struct i2c_client *i2c)
 
        regmap_del_irq_chip(palmas->irq, palmas->irq_data);
 
+       if (palmas == palmas_dev) {
+               pm_power_off = NULL;
+               palmas_dev = NULL;
+       }
+
        return 0;
 }