diff options
Diffstat (limited to 'drivers/char/misc.c')
-rw-r--r-- | drivers/char/misc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 0937544762da..3115d318b997 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -177,10 +177,10 @@ fail: | |||
177 | 177 | ||
178 | /* | 178 | /* |
179 | * TODO for 2.7: | 179 | * TODO for 2.7: |
180 | * - add a struct class_device to struct miscdevice and make all usages of | 180 | * - add a struct kref to struct miscdevice and make all usages of |
181 | * them dynamic. | 181 | * them dynamic. |
182 | */ | 182 | */ |
183 | static struct class_simple *misc_class; | 183 | static struct class *misc_class; |
184 | 184 | ||
185 | static struct file_operations misc_fops = { | 185 | static struct file_operations misc_fops = { |
186 | .owner = THIS_MODULE, | 186 | .owner = THIS_MODULE, |
@@ -238,8 +238,8 @@ int misc_register(struct miscdevice * misc) | |||
238 | } | 238 | } |
239 | dev = MKDEV(MISC_MAJOR, misc->minor); | 239 | dev = MKDEV(MISC_MAJOR, misc->minor); |
240 | 240 | ||
241 | misc->class = class_simple_device_add(misc_class, dev, | 241 | misc->class = class_device_create(misc_class, dev, misc->dev, |
242 | misc->dev, misc->name); | 242 | "%s", misc->name); |
243 | if (IS_ERR(misc->class)) { | 243 | if (IS_ERR(misc->class)) { |
244 | err = PTR_ERR(misc->class); | 244 | err = PTR_ERR(misc->class); |
245 | goto out; | 245 | goto out; |
@@ -248,7 +248,7 @@ int misc_register(struct miscdevice * misc) | |||
248 | err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, | 248 | err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, |
249 | misc->devfs_name); | 249 | misc->devfs_name); |
250 | if (err) { | 250 | if (err) { |
251 | class_simple_device_remove(dev); | 251 | class_device_destroy(misc_class, dev); |
252 | goto out; | 252 | goto out; |
253 | } | 253 | } |
254 | 254 | ||
@@ -281,7 +281,7 @@ int misc_deregister(struct miscdevice * misc) | |||
281 | 281 | ||
282 | down(&misc_sem); | 282 | down(&misc_sem); |
283 | list_del(&misc->list); | 283 | list_del(&misc->list); |
284 | class_simple_device_remove(MKDEV(MISC_MAJOR, misc->minor)); | 284 | class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); |
285 | devfs_remove(misc->devfs_name); | 285 | devfs_remove(misc->devfs_name); |
286 | if (i < DYNAMIC_MINORS && i>0) { | 286 | if (i < DYNAMIC_MINORS && i>0) { |
287 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); | 287 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); |
@@ -302,7 +302,7 @@ static int __init misc_init(void) | |||
302 | if (ent) | 302 | if (ent) |
303 | ent->proc_fops = &misc_proc_fops; | 303 | ent->proc_fops = &misc_proc_fops; |
304 | #endif | 304 | #endif |
305 | misc_class = class_simple_create(THIS_MODULE, "misc"); | 305 | misc_class = class_create(THIS_MODULE, "misc"); |
306 | if (IS_ERR(misc_class)) | 306 | if (IS_ERR(misc_class)) |
307 | return PTR_ERR(misc_class); | 307 | return PTR_ERR(misc_class); |
308 | #ifdef CONFIG_MVME16x | 308 | #ifdef CONFIG_MVME16x |
@@ -323,7 +323,7 @@ static int __init misc_init(void) | |||
323 | if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { | 323 | if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { |
324 | printk("unable to get major %d for misc devices\n", | 324 | printk("unable to get major %d for misc devices\n", |
325 | MISC_MAJOR); | 325 | MISC_MAJOR); |
326 | class_simple_destroy(misc_class); | 326 | class_destroy(misc_class); |
327 | return -EIO; | 327 | return -EIO; |
328 | } | 328 | } |
329 | return 0; | 329 | return 0; |