diff options
Diffstat (limited to 'drivers/char/misc.c')
-rw-r--r-- | drivers/char/misc.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 62ebe09656e3..7a484fc7cb9e 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -169,11 +169,6 @@ fail: | |||
169 | return err; | 169 | return err; |
170 | } | 170 | } |
171 | 171 | ||
172 | /* | ||
173 | * TODO for 2.7: | ||
174 | * - add a struct kref to struct miscdevice and make all usages of | ||
175 | * them dynamic. | ||
176 | */ | ||
177 | static struct class *misc_class; | 172 | static struct class *misc_class; |
178 | 173 | ||
179 | static const struct file_operations misc_fops = { | 174 | static const struct file_operations misc_fops = { |
@@ -228,10 +223,10 @@ int misc_register(struct miscdevice * misc) | |||
228 | misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); | 223 | misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); |
229 | dev = MKDEV(MISC_MAJOR, misc->minor); | 224 | dev = MKDEV(MISC_MAJOR, misc->minor); |
230 | 225 | ||
231 | misc->class = class_device_create(misc_class, NULL, dev, misc->dev, | 226 | misc->this_device = device_create(misc_class, misc->parent, dev, |
232 | "%s", misc->name); | 227 | "%s", misc->name); |
233 | if (IS_ERR(misc->class)) { | 228 | if (IS_ERR(misc->this_device)) { |
234 | err = PTR_ERR(misc->class); | 229 | err = PTR_ERR(misc->this_device); |
235 | goto out; | 230 | goto out; |
236 | } | 231 | } |
237 | 232 | ||
@@ -264,7 +259,7 @@ int misc_deregister(struct miscdevice * misc) | |||
264 | 259 | ||
265 | down(&misc_sem); | 260 | down(&misc_sem); |
266 | list_del(&misc->list); | 261 | list_del(&misc->list); |
267 | class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); | 262 | device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); |
268 | if (i < DYNAMIC_MINORS && i>0) { | 263 | if (i < DYNAMIC_MINORS && i>0) { |
269 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); | 264 | misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); |
270 | } | 265 | } |