mfd: max8907c: intialize pm_power_off
Bharat Nihalani [Tue, 21 Feb 2012 13:07:25 +0000 (18:07 +0530)]
Initialize pm_power_off based on use_power_off passed as platform
data.

Bug 943129

Change-Id: I0a158d226a046809a6d62cf8d9881152cfc2ab83
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/84946
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>

drivers/mfd/max8907c.c

index 2c57742..d03dbce 100644 (file)
@@ -310,6 +310,9 @@ static int max8907c_i2c_probe(struct i2c_client *i2c,
 
        ret = max8097c_add_subdevs(max8907c, pdata);
 
+       if (pdata->use_power_off && !pm_power_off)
+               pm_power_off = max8907c_power_off;
+
        if (pdata->max8907c_setup)
                return pdata->max8907c_setup();