- dev_t dev = MKDEV(ipmi_major, if_num);
- struct ipmi_reg_list *entry;
-
- mutex_lock(®_list_mutex);
- list_for_each_entry(entry, ®_list, link) {
- if (entry->dev == dev) {
- list_del(&entry->link);
- kfree(entry);
- break;
- }
- }
- class_device_destroy(ipmi_class, dev);
- mutex_unlock(®_list_mutex);
+ class_device_destroy(ipmi_class, MKDEV(ipmi_major, if_num));
+ devfs_remove("ipmidev/%d", if_num);