This patch cleanups registered devices on remove.
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return err;
}
+static int __devexit nvec_kbd_remove(struct platform_device *pdev)
+{
+ input_unregister_device(keys_dev.input);
+ input_free_device(keys_dev.input);
+
+ return 0;
+}
+
static struct platform_driver nvec_kbd_driver = {
.probe = nvec_kbd_probe,
+ .remove = __devexit_p(nvec_kbd_remove),
.driver = {
.name = "nvec-kbd",
.owner = THIS_MODULE,
return power_supply_register(&pdev->dev, psy);
}
+static int __devexit nvec_power_remove(struct platform_device *pdev)
+{
+ struct nvec_power *power = platform_get_drvdata(pdev);
+
+ cancel_delayed_work_sync(&power->poller);
+ switch (pdev->id) {
+ case AC:
+ power_supply_unregister(&nvec_psy);
+ break;
+ case BAT:
+ power_supply_unregister(&nvec_bat_psy);
+ }
+
+ return 0;
+}
+
static struct platform_driver nvec_power_driver = {
.probe = nvec_power_probe,
+ .remove = __devexit_p(nvec_power_remove),
.driver = {
.name = "nvec-power",
.owner = THIS_MODULE,
return 0;
}
+static int __devexit nvec_mouse_remove(struct platform_device *pdev)
+{
+ serio_unregister_port(ps2_dev.ser_dev);
+
+ return 0;
+}
+
#ifdef CONFIG_PM_SLEEP
static int nvec_mouse_suspend(struct device *dev)
{
static struct platform_driver nvec_mouse_driver = {
.probe = nvec_mouse_probe,
+ .remove = __devexit_p(nvec_mouse_remove),
.driver = {
.name = "nvec-mouse",
.owner = THIS_MODULE,