power: reset: ltc2952: disable timers in _remove
authorFrans Klaver <frans.klaver@xsens.com>
Wed, 14 Jan 2015 08:15:43 +0000 (09:15 +0100)
committerSebastian Reichel <sre@kernel.org>
Tue, 20 Jan 2015 12:58:30 +0000 (13:58 +0100)
Disable the timers when ltc2952_poweroff is removed. We don't want to
risk calling functions on data that no longer exist.

Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/reset/ltc2952-poweroff.c

index 8e04b3299f9a7898ce6dee38ccfefa1fe374ab8d..240b294a098049397c0cd6244d2cec3548b17923 100644 (file)
@@ -285,6 +285,8 @@ static int ltc2952_poweroff_remove(struct platform_device *pdev)
        struct ltc2952_poweroff *data = platform_get_drvdata(pdev);
 
        pm_power_off = NULL;
+       hrtimer_cancel(&data->timer_trigger);
+       hrtimer_cancel(&data->timer_wde);
        atomic_notifier_chain_unregister(&panic_notifier_list,
                                         &data->panic_notifier);
        return 0;