Lines Matching refs:misc
175 int misc_register(struct miscdevice *misc) in misc_register() argument
179 bool is_dynamic = (misc->minor == MISC_DYNAMIC_MINOR); in misc_register()
181 INIT_LIST_HEAD(&misc->list); in misc_register()
192 misc->minor = DYNAMIC_MINORS - i - 1; in misc_register()
198 if (c->minor == misc->minor) { in misc_register()
205 dev = MKDEV(MISC_MAJOR, misc->minor); in misc_register()
207 misc->this_device = in misc_register()
208 device_create_with_groups(misc_class, misc->parent, dev, in misc_register()
209 misc, misc->groups, "%s", misc->name); in misc_register()
210 if (IS_ERR(misc->this_device)) { in misc_register()
212 int i = DYNAMIC_MINORS - misc->minor - 1; in misc_register()
216 misc->minor = MISC_DYNAMIC_MINOR; in misc_register()
218 err = PTR_ERR(misc->this_device); in misc_register()
226 list_add(&misc->list, &misc_list); in misc_register()
241 void misc_deregister(struct miscdevice *misc) in misc_deregister() argument
243 int i = DYNAMIC_MINORS - misc->minor - 1; in misc_deregister()
245 if (WARN_ON(list_empty(&misc->list))) in misc_deregister()
249 list_del(&misc->list); in misc_deregister()
250 device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor)); in misc_deregister()