summaryrefslogtreecommitdiff
path: root/arch/arm/mach-bcm2708
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2015-04-30 21:10:18 +0200
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:13:01 +0100
commit2292ac3add3bf116bcbc7464ea5d0f311030cdc1 (patch)
treeb991d5e20d03b78812d80a2c2cf4b7f5043e4562 /arch/arm/mach-bcm2708
parent83b376b1b644986288b0f6e9427e595f06e51d4c (diff)
downloadlinux-2292ac3add3bf116bcbc7464ea5d0f311030cdc1.tar.gz
BCM2708: vcio: Move character device teardown to driver remove
chrdev is created in the probe function, but teared down in module exit. Move chrdev teardown to happen on device removal. Also add missing mbox_dev disabling. Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Diffstat (limited to 'arch/arm/mach-bcm2708')
-rw-r--r--arch/arm/mach-bcm2708/vcio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mach-bcm2708/vcio.c b/arch/arm/mach-bcm2708/vcio.c
index 270f126864ee..cac8dd7530e4 100644
--- a/arch/arm/mach-bcm2708/vcio.c
+++ b/arch/arm/mach-bcm2708/vcio.c
@@ -391,8 +391,12 @@ static int bcm_vcio_remove(struct platform_device *pdev)
{
struct vc_mailbox *mailbox = platform_get_drvdata(pdev);
+ mbox_dev = NULL;
platform_set_drvdata(pdev, NULL);
kfree(mailbox);
+ device_destroy(vcio_class, MKDEV(MAJOR_NUM, 0));
+ class_destroy(vcio_class);
+ unregister_chrdev(MAJOR_NUM, DEVICE_FILE_NAME);
return 0;
}
@@ -422,9 +426,6 @@ static int __init bcm_mbox_init(void)
static void __exit bcm_mbox_exit(void)
{
- device_destroy(vcio_class, MKDEV(MAJOR_NUM, 0));
- class_destroy(vcio_class);
- unregister_chrdev(MAJOR_NUM, DEVICE_FILE_NAME);
platform_driver_unregister(&bcm_mbox_driver);
}