summaryrefslogtreecommitdiff
path: root/arch/arm/mach-bcm2708
diff options
context:
space:
mode:
authorandroid <trevd1234@gmail.com>2014-08-25 13:18:21 +0100
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:11:48 +0100
commit2e4da5fe9cdf8094eb1c7ffa8ae6cc7b66ea3558 (patch)
treeeb047cde6c9f781082a2cd2b91308100a02597b8 /arch/arm/mach-bcm2708
parent7cc34a8cfdc1ce4f6e8bf7e35c49af68949d4eee (diff)
downloadlinux-2e4da5fe9cdf8094eb1c7ffa8ae6cc7b66ea3558.tar.gz
BCM2708_VCIO : Add automatic creation of device node
Diffstat (limited to 'arch/arm/mach-bcm2708')
-rw-r--r--arch/arm/mach-bcm2708/vcio.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/mach-bcm2708/vcio.c b/arch/arm/mach-bcm2708/vcio.c
index 5e43e851b301..700bff46f739 100644
--- a/arch/arm/mach-bcm2708/vcio.c
+++ b/arch/arm/mach-bcm2708/vcio.c
@@ -61,7 +61,7 @@
#define MBOX_DATA28_LSB(msg) (((uint32_t)msg) >> 4)
#define MBOX_MAGIC 0xd0d0c0de
-
+static struct class *vcio_class = NULL;
struct vc_mailbox {
struct device *dev; /* parent device */
void __iomem *status;
@@ -421,6 +421,13 @@ static int bcm_vcio_probe(struct platform_device *pdev)
"Failed registering the character device %d\n", ret);
return ret;
}
+ vcio_class = class_create(THIS_MODULE, BCM_VCIO_DRIVER_NAME);
+ if (IS_ERR(vcio_class)) {
+ ret = PTR_ERR(vcio_class);
+ return ret ;
+ }
+ device_create(vcio_class, NULL, MKDEV(MAJOR_NUM, 0), NULL,
+ "vcio");
}
return ret;
}
@@ -462,6 +469,9 @@ 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);
}