mfd: rk808: Check pm_power_off pointer

The function pointer pm_power_off may point to function from other
module (PSCI for example). If rk808 is removed, pm_power_off is
overwritten to NULL and the system cannot be powered off.

This patch checks if pm_power_off points to a module function.

Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
Stefan Mavrodiev
2019-06-07 15:42:25 +03:00
committed by Lee Jones
parent 554e937ec8
commit 7630499464
2 changed files with 12 additions and 6 deletions

View File

@@ -628,5 +628,6 @@ struct rk808 {
long variant;
const struct regmap_config *regmap_cfg;
const struct regmap_irq_chip *regmap_irq_chip;
void (*pm_pwroff_fn)(void);
};
#endif /* __LINUX_REGULATOR_RK808_H */