Commit b101426a authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by John W. Linville

rsi: Use module_usb_driver

module_usb_driver eliminates the boilerplate and makes the code simpler,
in addition to the fact currently rsi_module_init() ignores usb_deregister() error.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ef0a68a8
......@@ -550,33 +550,7 @@ static struct usb_driver rsi_driver = {
#endif
};
/**
* rsi_module_init() - This function registers the client driver.
* @void: Void.
*
* Return: 0 on success.
*/
static int rsi_module_init(void)
{
usb_register(&rsi_driver);
rsi_dbg(INIT_ZONE, "%s: Registering driver\n", __func__);
return 0;
}
/**
* rsi_module_exit() - This function unregisters the client driver.
* @void: Void.
*
* Return: None.
*/
static void rsi_module_exit(void)
{
usb_deregister(&rsi_driver);
rsi_dbg(INFO_ZONE, "%s: Unregistering driver\n", __func__);
}
module_init(rsi_module_init);
module_exit(rsi_module_exit);
module_usb_driver(rsi_driver);
MODULE_AUTHOR("Redpine Signals Inc");
MODULE_DESCRIPTION("Common USB layer for RSI drivers");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment