[PATCH v2] staging: most: hdm_usb: Driver registration with module_driver macro
Alex Briskin
br.shurik at gmail.com
Fri Aug 25 16:28:19 UTC 2017
OK got it
On 08/25/2017 07:19 PM, Andrey Shvetsov wrote:
> On Fri, Aug 25, 2017 at 06:40:18PM +0300, Alex Briskin wrote:
>> 1. Remove redundant functions.
>> 2. Remove potentially missleading return code (-EIO).
>> 3. Add module_driver driver registration macro.
> s/module_driver/module_usb_driver/
>
> /andy
>
>> * Will also remove pr_info messages.
>>
>> Signed-off-by: Alex Briskin <br.shurik at gmail.com>
>> ---
>> drivers/staging/most/hdm-usb/hdm_usb.c | 20 +-------------------
>> 1 file changed, 1 insertion(+), 19 deletions(-)
>>
>> diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
>> index a9c3785d19ae..85775da293fb 100644
>> --- a/drivers/staging/most/hdm-usb/hdm_usb.c
>> +++ b/drivers/staging/most/hdm-usb/hdm_usb.c
>> @@ -1301,25 +1301,7 @@ static struct usb_driver hdm_usb = {
>> .disconnect = hdm_disconnect,
>> };
>>
>> -static int __init hdm_usb_init(void)
>> -{
>> - pr_info("hdm_usb_init()\n");
>> - if (usb_register(&hdm_usb)) {
>> - pr_err("could not register hdm_usb driver\n");
>> - return -EIO;
>> - }
>> -
>> - return 0;
>> -}
>> -
>> -static void __exit hdm_usb_exit(void)
>> -{
>> - pr_info("hdm_usb_exit()\n");
>> - usb_deregister(&hdm_usb);
>> -}
>> -
>> -module_init(hdm_usb_init);
>> -module_exit(hdm_usb_exit);
>> +module_usb_driver(hdm_usb);
>> MODULE_LICENSE("GPL");
>> MODULE_AUTHOR("Christian Gromm <christian.gromm at microchip.com>");
>> MODULE_DESCRIPTION("HDM_4_USB");
>> --
>> 2.11.0
>>
>> _______________________________________________
>> devel mailing list
>> devel at linuxdriverproject.org
>> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
More information about the devel
mailing list