Lines Matching full:misc
3 * linux/drivers/char/misc.c
5 * Generic misc open routine by Johan Myreen
15 * of the misc drivers, as they are now completely independent. Linus.
24 * Renamed to misc and miscdevice to be more accurate. Alan Cox 26-Mar-96
183 .name = "misc",
195 * @misc: device structure
211 int misc_register(struct miscdevice *misc) in misc_register() argument
215 bool is_dynamic = (misc->minor == MISC_DYNAMIC_MINOR); in misc_register()
217 INIT_LIST_HEAD(&misc->list); in misc_register()
228 misc->minor = i; in misc_register()
233 if (c->minor == misc->minor) { in misc_register()
240 dev = MKDEV(MISC_MAJOR, misc->minor); in misc_register()
242 misc->this_device = in misc_register()
243 device_create_with_groups(&misc_class, misc->parent, dev, in misc_register()
244 misc, misc->groups, "%s", misc->name); in misc_register()
245 if (IS_ERR(misc->this_device)) { in misc_register()
247 misc_minor_free(misc->minor); in misc_register()
248 misc->minor = MISC_DYNAMIC_MINOR; in misc_register()
250 err = PTR_ERR(misc->this_device); in misc_register()
258 list_add(&misc->list, &misc_list); in misc_register()
267 * @misc: device to unregister
273 void misc_deregister(struct miscdevice *misc) in misc_deregister() argument
275 if (WARN_ON(list_empty(&misc->list))) in misc_deregister()
279 list_del(&misc->list); in misc_deregister()
280 device_destroy(&misc_class, MKDEV(MISC_MAJOR, misc->minor)); in misc_deregister()
281 misc_minor_free(misc->minor); in misc_deregister()
291 ret = proc_create_seq("misc", 0, NULL, &misc_seq_ops); in misc_init()
297 if (register_chrdev(MISC_MAJOR, "misc", &misc_fops)) in misc_init()
302 pr_err("unable to get major %d for misc devices\n", MISC_MAJOR); in misc_init()
306 remove_proc_entry("misc", NULL); in misc_init()