Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: rts5208: Use module_pci_driver

Macro module_pci_driver is used for drivers whose init
and exit paths does only register and unregister to pci
API. So, here remove some boilerplate code by using
module_pci_driver. Also, change driver to rtsx_driver,
to avoid implicitly redefining driver_init.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Vaishali Thakkar and committed by
Greg Kroah-Hartman
eb740375 5cc8c568

+2 -19
+2 -19
drivers/staging/rts5208/rtsx.c
··· 1036 1036 MODULE_DEVICE_TABLE(pci, rtsx_ids); 1037 1037 1038 1038 /* pci_driver definition */ 1039 - static struct pci_driver driver = { 1039 + static struct pci_driver rtsx_driver = { 1040 1040 .name = CR_DRIVER_NAME, 1041 1041 .id_table = rtsx_ids, 1042 1042 .probe = rtsx_probe, ··· 1048 1048 .shutdown = rtsx_shutdown, 1049 1049 }; 1050 1050 1051 - static int __init rtsx_init(void) 1052 - { 1053 - pr_info("Initializing Realtek PCIE storage driver...\n"); 1054 - 1055 - return pci_register_driver(&driver); 1056 - } 1057 - 1058 - static void __exit rtsx_exit(void) 1059 - { 1060 - pr_info("rtsx_exit() called\n"); 1061 - 1062 - pci_unregister_driver(&driver); 1063 - 1064 - pr_info("%s module exit\n", CR_DRIVER_NAME); 1065 - } 1066 - 1067 - module_init(rtsx_init) 1068 - module_exit(rtsx_exit) 1051 + module_pci_driver(rtsx_driver);