diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-07-27 19:16:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 17:51:59 -0500 |
commit | 94fbcded4ea0dc14cbfb222a5c68372f150d1476 (patch) | |
tree | fcbf2d5f71a9993666a1c8d1883273f8046f8625 /drivers/char/misc.c | |
parent | cd15422b9f39155e2d9ea56ae95c6f62aa5df42e (diff) |
Driver core: change misc class_devices to be real devices
This also ment that some of the misc drivers had to also be fixed
up as they were assuming the device was a class_device.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 62ebe09656e..7a484fc7cb9 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 | } |