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

ethernet: realtek: use module_pci_driver

This patch converts to use the macro module_pci_driver, which makes
the code smaller and simpler.

Previously in this driver we are having driver version info will be
printed log buffer based on whether the driver selected as module
or statically into image itself. By using the module_pci_driver that
part of the code removed. For the first time of the device init,
we are making the version info to be printed once.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Varka Bhadram and committed by
David S. Miller
5490c272 274f482d

+2 -20
+2 -20
drivers/net/ethernet/realtek/8139cp.c
··· 1887 1887 resource_size_t pciaddr; 1888 1888 unsigned int addr_len, i, pci_using_dac; 1889 1889 1890 - #ifndef MODULE 1891 - static int version_printed; 1892 - if (version_printed++ == 0) 1893 - pr_info("%s", version); 1894 - #endif 1890 + pr_info_once("%s", version); 1895 1891 1896 1892 if (pdev->vendor == PCI_VENDOR_ID_REALTEK && 1897 1893 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) { ··· 2117 2121 #endif 2118 2122 }; 2119 2123 2120 - static int __init cp_init (void) 2121 - { 2122 - #ifdef MODULE 2123 - pr_info("%s", version); 2124 - #endif 2125 - return pci_register_driver(&cp_driver); 2126 - } 2127 - 2128 - static void __exit cp_exit (void) 2129 - { 2130 - pci_unregister_driver (&cp_driver); 2131 - } 2132 - 2133 - module_init(cp_init); 2134 - module_exit(cp_exit); 2124 + module_pci_driver(cp_driver);