Skip to contentSkip to conversation

usb/misc/usb3503: Use module_i2c_driver to register driver

PATCH In review Peter Huewe 1 participant 2 messages May 20, 2013 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb/misc/usb3503: Use module_i2c_driver to register driver

Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions

---
 drivers/usb/misc/usb3503.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/usb/misc/usb3503.c +1 -13
index f713f6a..72d1771 100644
@@ -307,19 +307,7 @@ static struct i2c_driver usb3503_driver = {
 	.id_table	= usb3503_id,
 };
 
-static int __init usb3503_init(void)
-{
-	return i2c_add_driver(&usb3503_driver);
-}
-
-static void __exit usb3503_exit(void)
-{
-	i2c_del_driver(&usb3503_driver);
-}
-
-module_init(usb3503_init);
-module_exit(usb3503_exit);
-
+module_i2c_driver(usb3503_driver);
 MODULE_AUTHOR("Dongjin Kim <[email protected]>");
 MODULE_DESCRIPTION("USB3503 USB HUB driver");
 MODULE_LICENSE("GPL");
Signature · 1 line
1.8.1.5
#1 lore raw

Am Montag, 20. Mai 2013, 21:31:57 schrieb Peter Huewe:

Quoted 5 lines

Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions

---

Sorry for the noise
already exists in 3.10-rc1 by Lars-Peter Clausen
8244ac0 USB: misc: usb3503: use module_i2c_driver to simplify the code

I was working on an stale tree - sorry.
Please ignore this patch.

Peter