struct device dev;
struct device_driver drv;
struct bus_type bus;
- struct class *class;
struct list_head comp_list;
} mc;
pr_info("Cannot register most bus\n");
return err;
}
- mc.class = class_create(THIS_MODULE, "most");
- if (IS_ERR(mc.class)) {
- pr_info("No udev support.\n");
- err = PTR_ERR(mc.class);
- goto exit_bus;
- }
-
err = driver_register(&mc.drv);
if (err) {
pr_info("Cannot register core driver\n");
- goto exit_class;
+ goto exit_bus;
}
mc.dev.init_name = "most_bus";
mc.dev.release = release_most_sub;
exit_driver:
driver_unregister(&mc.drv);
-exit_class:
- class_destroy(mc.class);
exit_bus:
bus_unregister(&mc.bus);
return err;
pr_info("exit core module\n");
device_unregister(&mc.dev);
driver_unregister(&mc.drv);
- class_destroy(mc.class);
bus_unregister(&mc.bus);
ida_destroy(&mdev_id);
}