diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-17 17:43:27 +0530 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-02-17 14:19:30 +0100 |
commit | a6ddd2f1b99f1c00b4e00289b13c3e451c7130b0 (patch) | |
tree | d06391a9709ff718d4fa5fa983148916e355987e /drivers/gpu | |
parent | b06b31d5ee62fd90cfc5a137f9d1ecea51084067 (diff) |
drm/udl: Use module_usb_driver
Macro module_usb_driver is used for drivers whose init and exit paths
only register and unregister to usb API. So remove boilerplate code to
make code simpler by using module_usb_driver.
This change was made with the help of the following Coccinelle
semantic patch:
//<smpl>
@a@
identifier f, x;
@@
-static f(...) { return usb_register(&x); }
@b depends on a@
identifier e, a.x;
@@
-static e(...) { usb_deregister(&x); }
@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);
@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_usb_driver;
@@
-module_exit(e);
+module_usb_driver(x);
//</smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160217121327.GA29682@amitoj-Inspiron-3542
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/udl/udl_drv.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c index d5728ec85254..772ec9e1f590 100644 --- a/drivers/gpu/drm/udl/udl_drv.c +++ b/drivers/gpu/drm/udl/udl_drv.c @@ -125,17 +125,5 @@ static struct usb_driver udl_driver = { .disconnect = udl_usb_disconnect, .id_table = id_table, }; - -static int __init udl_init(void) -{ - return usb_register(&udl_driver); -} - -static void __exit udl_exit(void) -{ - usb_deregister(&udl_driver); -} - -module_init(udl_init); -module_exit(udl_exit); +module_usb_driver(udl_driver); MODULE_LICENSE("GPL"); |