最終更新:2014-05-11 (日) 19:17:22 (2325d)  

module_usb_driver
Top / module_usb_driver

module_init時にusb_registerだけ、module_exit?時にusb_deregister?だけ行う

#define module_usb_driver(__usb_driver) \
        module_driver(__usb_driver, usb_register, usb_deregister)

usb_mouse_driver?が引数の場合

static int __init usb_mouse_driver_init(void)
{
        return usb_register(&(usb_mouse_driver) , ##__VA_ARGS__);
}
module_init(usb_mouse_driver_init);
static void __exit usb_mouse_driver_exit(void)
{
        usb_deregister(&(usb_mouse_driver) , ##__VA_ARGS__);
}
module_exit(usb_mouse_driver_exit);

呼び出し

  • module_driver - Helper macro for drivers that don't do anything special in module init/exit. This eliminates a lot of boilerplate.

関連