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

Configure Feed

Select the types of activity you want to include in your feed.

net: ethernet: use module_pci_driver; remove useless driver versions

The module version is useless, and the only thing these drivers' init
routines did besides pci_register_driver was to print the driver name
and/or version.

Acked-by: Francois Romieu <romieu@fr.zoreil.com> (epic100)
Reviewed-by: Simon Horman <horms@kernel.org> (epic100, sis900)
Reviewed-by: Sai Krishna <saikrishnag@marvell.com> (epic100)
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Link: https://patch.msgid.link/20260131022441.56274-1-enelsonmoore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ethan Nelson-Moore and committed by
Jakub Kicinski
14e6cf84 dc9fd14b

+3 -103
+1 -39
drivers/net/ethernet/realtek/8139too.c
··· 92 92 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 93 93 94 94 #define DRV_NAME "8139too" 95 - #define DRV_VERSION "0.9.28" 96 - 97 95 98 96 #include <linux/module.h> 99 97 #include <linux/kernel.h> ··· 112 114 #include <linux/gfp.h> 113 115 #include <linux/if_vlan.h> 114 116 #include <asm/irq.h> 115 - 116 - #define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION 117 117 118 118 /* Default Message level */ 119 119 #define RTL8139_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ ··· 619 623 MODULE_AUTHOR ("Jeff Garzik <jgarzik@pobox.com>"); 620 624 MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver"); 621 625 MODULE_LICENSE("GPL"); 622 - MODULE_VERSION(DRV_VERSION); 623 626 624 627 module_param(use_io, bool, 0); 625 628 MODULE_PARM_DESC(use_io, "Force use of I/O access mode. 0=MMIO 1=PIO"); ··· 949 954 assert (ent != NULL); 950 955 951 956 board_idx++; 952 - 953 - /* when we're built into the kernel, the driver version message 954 - * is only printed if at least one 8139 board has been found 955 - */ 956 - #ifndef MODULE 957 - { 958 - static int printed_version; 959 - if (!printed_version++) 960 - pr_info(RTL8139_DRIVER_NAME "\n"); 961 - } 962 - #endif 963 957 964 958 if (pdev->vendor == PCI_VENDOR_ID_REALTEK && 965 959 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >= 0x20) { ··· 2367 2383 { 2368 2384 struct rtl8139_private *tp = netdev_priv(dev); 2369 2385 strscpy(info->driver, DRV_NAME, sizeof(info->driver)); 2370 - strscpy(info->version, DRV_VERSION, sizeof(info->version)); 2371 2386 strscpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info)); 2372 2387 } 2373 2388 ··· 2639 2656 .driver.pm = &rtl8139_pm_ops, 2640 2657 }; 2641 2658 2642 - 2643 - static int __init rtl8139_init_module (void) 2644 - { 2645 - /* when we're a module, we always print a version message, 2646 - * even if no 8139 board is found. 2647 - */ 2648 - #ifdef MODULE 2649 - pr_info(RTL8139_DRIVER_NAME "\n"); 2650 - #endif 2651 - 2652 - return pci_register_driver(&rtl8139_pci_driver); 2653 - } 2654 - 2655 - 2656 - static void __exit rtl8139_cleanup_module (void) 2657 - { 2658 - pci_unregister_driver (&rtl8139_pci_driver); 2659 - } 2660 - 2661 - 2662 - module_init(rtl8139_init_module); 2663 - module_exit(rtl8139_cleanup_module); 2659 + module_pci_driver(rtl8139_pci_driver);
+1 -30
drivers/net/ethernet/sis/sis900.c
··· 79 79 #include "sis900.h" 80 80 81 81 #define SIS900_MODULE_NAME "sis900" 82 - #define SIS900_DRV_VERSION "v1.08.10 Apr. 2 2006" 83 - 84 - static const char version[] = 85 - KERN_INFO "sis900.c: " SIS900_DRV_VERSION "\n"; 86 82 87 83 static int max_interrupt_work = 40; 88 84 static int multicast_filter_limit = 128; ··· 437 441 int i, ret; 438 442 const char *card_name = card_names[pci_id->driver_data]; 439 443 const char *dev_name = pci_name(pci_dev); 440 - 441 - /* when built into the kernel, we only print version if device is found */ 442 - #ifndef MODULE 443 - static int printed_version; 444 - if (!printed_version++) 445 - printk(version); 446 - #endif 447 444 448 445 /* setup various bits in PCI command register */ 449 446 ret = pcim_enable_device(pci_dev); ··· 2018 2029 struct sis900_private *sis_priv = netdev_priv(net_dev); 2019 2030 2020 2031 strscpy(info->driver, SIS900_MODULE_NAME, sizeof(info->driver)); 2021 - strscpy(info->version, SIS900_DRV_VERSION, sizeof(info->version)); 2022 2032 strscpy(info->bus_info, pci_name(sis_priv->pci_dev), 2023 2033 sizeof(info->bus_info)); 2024 2034 } ··· 2555 2567 .driver.pm = &sis900_pm_ops, 2556 2568 }; 2557 2569 2558 - static int __init sis900_init_module(void) 2559 - { 2560 - /* when a module, this is printed whether or not devices are found in probe */ 2561 - #ifdef MODULE 2562 - printk(version); 2563 - #endif 2564 - 2565 - return pci_register_driver(&sis900_pci_driver); 2566 - } 2567 - 2568 - static void __exit sis900_cleanup_module(void) 2569 - { 2570 - pci_unregister_driver(&sis900_pci_driver); 2571 - } 2572 - 2573 - module_init(sis900_init_module); 2574 - module_exit(sis900_cleanup_module); 2575 - 2570 + module_pci_driver(sis900_pci_driver);
+1 -34
drivers/net/ethernet/smsc/epic100.c
··· 26 26 */ 27 27 28 28 #define DRV_NAME "epic100" 29 - #define DRV_VERSION "2.1" 30 - #define DRV_RELDATE "Sept 11, 2006" 31 29 32 30 /* The user-configurable values. 33 31 These may be modified when a driver module is loaded.*/ ··· 86 88 #include <asm/io.h> 87 89 #include <linux/uaccess.h> 88 90 #include <asm/byteorder.h> 89 - 90 - /* These identify the driver base version and may not be removed. */ 91 - static char version[] = 92 - DRV_NAME ".c:v1.11 1/7/2001 Written by Donald Becker <becker@scyld.com>"; 93 - static char version2[] = 94 - " (unofficial 2.4.x kernel port, version " DRV_VERSION ", " DRV_RELDATE ")"; 95 91 96 92 MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 97 93 MODULE_DESCRIPTION("SMC 83c170 EPIC series Ethernet driver"); ··· 320 328 __le16 addr[ETH_ALEN / 2]; 321 329 void *ring_space; 322 330 dma_addr_t ring_dma; 323 - 324 - /* when built into the kernel, we only print version if device is found */ 325 - #ifndef MODULE 326 - pr_info_once("%s%s\n", version, version2); 327 - #endif 328 331 329 332 card_idx++; 330 333 ··· 1380 1393 struct epic_private *np = netdev_priv(dev); 1381 1394 1382 1395 strscpy(info->driver, DRV_NAME, sizeof(info->driver)); 1383 - strscpy(info->version, DRV_VERSION, sizeof(info->version)); 1384 1396 strscpy(info->bus_info, pci_name(np->pci_dev), sizeof(info->bus_info)); 1385 1397 } 1386 1398 ··· 1550 1564 .driver.pm = &epic_pm_ops, 1551 1565 }; 1552 1566 1553 - 1554 - static int __init epic_init (void) 1555 - { 1556 - /* when a module, this is printed whether or not devices are found in probe */ 1557 - #ifdef MODULE 1558 - pr_info("%s%s\n", version, version2); 1559 - #endif 1560 - 1561 - return pci_register_driver(&epic_driver); 1562 - } 1563 - 1564 - 1565 - static void __exit epic_cleanup (void) 1566 - { 1567 - pci_unregister_driver (&epic_driver); 1568 - } 1569 - 1570 - 1571 - module_init(epic_init); 1572 - module_exit(epic_cleanup); 1567 + module_pci_driver(epic_driver);