brcm2708: update to v3.18
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-3.18 / 0111-BCM2708_VCIO-Add-automatic-creation-of-device-node.patch
1 From 7fa07e9f8c88a5a628b9ca8a843d3490a59fb9cb Mon Sep 17 00:00:00 2001
2 From: android <trevd1234@gmail.com>
3 Date: Mon, 25 Aug 2014 13:18:21 +0100
4 Subject: [PATCH 111/114] BCM2708_VCIO : Add automatic creation of device node
5
6 ---
7 arch/arm/mach-bcm2708/vcio.c | 12 +++++++++++-
8 arch/arm/mach-bcm2709/vcio.c | 12 +++++++++++-
9 2 files changed, 22 insertions(+), 2 deletions(-)
10
11 diff --git a/arch/arm/mach-bcm2708/vcio.c b/arch/arm/mach-bcm2708/vcio.c
12 index 5e43e85..700bff4 100644
13 --- a/arch/arm/mach-bcm2708/vcio.c
14 +++ b/arch/arm/mach-bcm2708/vcio.c
15 @@ -61,7 +61,7 @@
16 #define MBOX_DATA28_LSB(msg) (((uint32_t)msg) >> 4)
17
18 #define MBOX_MAGIC 0xd0d0c0de
19 -
20 +static struct class *vcio_class = NULL;
21 struct vc_mailbox {
22 struct device *dev; /* parent device */
23 void __iomem *status;
24 @@ -421,6 +421,13 @@ static int bcm_vcio_probe(struct platform_device *pdev)
25 "Failed registering the character device %d\n", ret);
26 return ret;
27 }
28 + vcio_class = class_create(THIS_MODULE, BCM_VCIO_DRIVER_NAME);
29 + if (IS_ERR(vcio_class)) {
30 + ret = PTR_ERR(vcio_class);
31 + return ret ;
32 + }
33 + device_create(vcio_class, NULL, MKDEV(MAJOR_NUM, 0), NULL,
34 + "vcio");
35 }
36 return ret;
37 }
38 @@ -462,6 +469,9 @@ static int __init bcm_mbox_init(void)
39
40 static void __exit bcm_mbox_exit(void)
41 {
42 + device_destroy(vcio_class,MKDEV(MAJOR_NUM, 0));
43 + class_destroy(vcio_class);
44 + unregister_chrdev(MAJOR_NUM, DEVICE_FILE_NAME);
45 platform_driver_unregister(&bcm_mbox_driver);
46 }
47
48 diff --git a/arch/arm/mach-bcm2709/vcio.c b/arch/arm/mach-bcm2709/vcio.c
49 index 5e43e85..700bff4 100644
50 --- a/arch/arm/mach-bcm2709/vcio.c
51 +++ b/arch/arm/mach-bcm2709/vcio.c
52 @@ -61,7 +61,7 @@
53 #define MBOX_DATA28_LSB(msg) (((uint32_t)msg) >> 4)
54
55 #define MBOX_MAGIC 0xd0d0c0de
56 -
57 +static struct class *vcio_class = NULL;
58 struct vc_mailbox {
59 struct device *dev; /* parent device */
60 void __iomem *status;
61 @@ -421,6 +421,13 @@ static int bcm_vcio_probe(struct platform_device *pdev)
62 "Failed registering the character device %d\n", ret);
63 return ret;
64 }
65 + vcio_class = class_create(THIS_MODULE, BCM_VCIO_DRIVER_NAME);
66 + if (IS_ERR(vcio_class)) {
67 + ret = PTR_ERR(vcio_class);
68 + return ret ;
69 + }
70 + device_create(vcio_class, NULL, MKDEV(MAJOR_NUM, 0), NULL,
71 + "vcio");
72 }
73 return ret;
74 }
75 @@ -462,6 +469,9 @@ static int __init bcm_mbox_init(void)
76
77 static void __exit bcm_mbox_exit(void)
78 {
79 + device_destroy(vcio_class,MKDEV(MAJOR_NUM, 0));
80 + class_destroy(vcio_class);
81 + unregister_chrdev(MAJOR_NUM, DEVICE_FILE_NAME);
82 platform_driver_unregister(&bcm_mbox_driver);
83 }
84
85 --
86 1.8.3.2
87