aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/misc.c')
-rw-r--r--drivers/char/misc.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 96eb2a709e21..d5fa19da330b 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -34,7 +34,6 @@
34 */ 34 */
35 35
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/config.h>
38 37
39#include <linux/fs.h> 38#include <linux/fs.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
@@ -44,7 +43,6 @@
44#include <linux/slab.h> 43#include <linux/slab.h>
45#include <linux/proc_fs.h> 44#include <linux/proc_fs.h>
46#include <linux/seq_file.h> 45#include <linux/seq_file.h>
47#include <linux/devfs_fs_kernel.h>
48#include <linux/stat.h> 46#include <linux/stat.h>
49#include <linux/init.h> 47#include <linux/init.h>
50#include <linux/device.h> 48#include <linux/device.h>
@@ -204,7 +202,7 @@ int misc_register(struct miscdevice * misc)
204{ 202{
205 struct miscdevice *c; 203 struct miscdevice *c;
206 dev_t dev; 204 dev_t dev;
207 int err; 205 int err = 0;
208 206
209 down(&misc_sem); 207 down(&misc_sem);
210 list_for_each_entry(c, &misc_list, list) { 208 list_for_each_entry(c, &misc_list, list) {
@@ -228,10 +226,6 @@ int misc_register(struct miscdevice * misc)
228 226
229 if (misc->minor < DYNAMIC_MINORS) 227 if (misc->minor < DYNAMIC_MINORS)
230 misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); 228 misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
231 if (misc->devfs_name[0] == '\0') {
232 snprintf(misc->devfs_name, sizeof(misc->devfs_name),
233 "misc/%s", misc->name);
234 }
235 dev = MKDEV(MISC_MAJOR, misc->minor); 229 dev = MKDEV(MISC_MAJOR, misc->minor);
236 230
237 misc->class = class_device_create(misc_class, NULL, dev, misc->dev, 231 misc->class = class_device_create(misc_class, NULL, dev, misc->dev,
@@ -241,13 +235,6 @@ int misc_register(struct miscdevice * misc)
241 goto out; 235 goto out;
242 } 236 }
243 237
244 err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,
245 misc->devfs_name);
246 if (err) {
247 class_device_destroy(misc_class, dev);
248 goto out;
249 }
250
251 /* 238 /*
252 * Add it to the front, so that later devices can "override" 239 * Add it to the front, so that later devices can "override"
253 * earlier defaults 240 * earlier defaults
@@ -278,7 +265,6 @@ int misc_deregister(struct miscdevice * misc)
278 down(&misc_sem); 265 down(&misc_sem);
279 list_del(&misc->list); 266 list_del(&misc->list);
280 class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); 267 class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
281 devfs_remove(misc->devfs_name);
282 if (i < DYNAMIC_MINORS && i>0) { 268 if (i < DYNAMIC_MINORS && i>0) {
283 misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); 269 misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
284 } 270 }