- class = class_simple_device_add(misc_class, dev,
- misc->dev, misc->name);
- if (IS_ERR(class)) {
- err = PTR_ERR(class);
- goto out;
- }
-
- err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,
- misc->devfs_name);
- if (err) {
- class_simple_device_remove(dev);
+ misc->this_device = device_create(misc_class, misc->parent, dev,
+ "%s", misc->name);
+ if (IS_ERR(misc->this_device)) {
+ err = PTR_ERR(misc->this_device);