diff options
author | Marc Dietrich <marvin24@gmx.de> | 2012-06-24 23:25:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-25 10:55:38 -0700 |
commit | 3cdde3a3d55e64e6d1ae3465701c8d9f226775f3 (patch) | |
tree | fa22619c8e6f81ac6d34c3affffeab0514046ce7 /drivers/staging | |
parent | ac562680577a28fa98ebecebff5e5097ccf9a9d2 (diff) | |
download | linux-3cdde3a3d55e64e6d1ae3465701c8d9f226775f3.tar.bz2 |
staging: nvec: add remove function to nvec childs
This patch cleanups registered devices on remove.
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/nvec/nvec_kbd.c | 9 | ||||
-rw-r--r-- | drivers/staging/nvec/nvec_power.c | 17 | ||||
-rw-r--r-- | drivers/staging/nvec/nvec_ps2.c | 8 |
3 files changed, 34 insertions, 0 deletions
diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c index 36ef6a6b01af..6cc30dcd8306 100644 --- a/drivers/staging/nvec/nvec_kbd.c +++ b/drivers/staging/nvec/nvec_kbd.c @@ -159,8 +159,17 @@ fail: 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, diff --git a/drivers/staging/nvec/nvec_power.c b/drivers/staging/nvec/nvec_power.c index 063f6d5e8ab1..cc8ccd75e7f4 100644 --- a/drivers/staging/nvec/nvec_power.c +++ b/drivers/staging/nvec/nvec_power.c @@ -407,8 +407,25 @@ static int __devinit nvec_power_probe(struct platform_device *pdev) 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, diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c index 2481df2d3bfc..d7c651102131 100644 --- a/drivers/staging/nvec/nvec_ps2.c +++ b/drivers/staging/nvec/nvec_ps2.c @@ -123,6 +123,13 @@ static int __devinit nvec_mouse_probe(struct platform_device *pdev) 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) { @@ -157,6 +164,7 @@ static const SIMPLE_DEV_PM_OPS(nvec_mouse_pm_ops, nvec_mouse_suspend, static struct platform_driver nvec_mouse_driver = { .probe = nvec_mouse_probe, + .remove = __devexit_p(nvec_mouse_remove), .driver = { .name = "nvec-mouse", .owner = THIS_MODULE, |