epic100: remove module version and switch to module_pci_driver
Subsystems (3)
PATCH 1/1 epic100: remove module version and switch to module_pci_driver
The module version is useless, and the only thing the epic_init routine did besides pci_register_driver was to print the version.
--- drivers/net/ethernet/smsc/epic100.c | 35 +---------------------------- 1 file changed, 1 insertion(+), 34 deletions(-)
drivers/net/ethernet/smsc/epic100.c +1 -34
@@ -26,8 +26,6 @@*/ #define DRV_NAME "epic100" -#define DRV_VERSION "2.1" -#define DRV_RELDATE "Sept 11, 2006"/* The user-configurable values. These may be modified when a driver module is loaded.*/
@@ -89,12 +87,6 @@ static int rx_copybreak;#include <linux/uaccess.h> #include <asm/byteorder.h> -/* These identify the driver base version and may not be removed. */ -static char version[] = -DRV_NAME ".c:v1.11 1/7/2001 Written by Donald Becker <[email protected]>" ; -static char version2[] = -" (unofficial 2.4.x kernel port, version " DRV_VERSION ", " DRV_RELDATE ")" ; -MODULE_AUTHOR ("Donald Becker <[email protected]>" );MODULE_DESCRIPTION ("SMC 83c170 EPIC series Ethernet driver" );MODULE_LICENSE ("GPL" );
@@ -329,11 +321,6 @@ static int epic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)void *ring_space;dma_addr_t ring_dma; -/* when built into the kernel, we only print version if device is found */ -#ifndef MODULE -pr_info_once ("%s%s\n" , version, version2); -#endif - card_idx++; ret =pci_enable_device (pdev);
@@ -1393,7 +1380,6 @@ static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *struct epic_private *np =netdev_priv (dev);strscpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strscpy (info->version,DRV_VERSION ,sizeof (info->version));strscpy (info->bus_info,pci_name (np->pci_dev),sizeof (info->bus_info)); }
@@ -1564,23 +1550,4 @@ static struct pci_driver epic_driver = { .driver.pm = &epic_pm_ops, }; - -static int __init epic_init (void ) -{ -/* when a module, this is printed whether or not devices are found in probe */ -#ifdef MODULE -pr_info ("%s%s\n" , version, version2); -#endif - -return pci_register_driver (&epic_driver); -} - - -static void __exit epic_cleanup (void) -{ -pci_unregister_driver (&epic_driver); -} - - -module_init (epic_init); -module_exit (epic_cleanup); +module_pci_driver (epic_driver);
Signature · 1 line
2.43.0
PATCH 1/1 net: 8139too: switch to module_pci_driver; remove driver version
The module version is useless, and the only thing the rtl8139_init_module routine did besides pci_register_driver was to print the driver name and version.
Also replace hardcoded DRV_NAME macro with KBUILD_MODNAME, which has the same value.
--- drivers/net/ethernet/realtek/8139too.c | 48 +++----------------------- 1 file changed, 4 insertions(+), 44 deletions(-)
drivers/net/ethernet/realtek/8139too.c +4 -44
@@ -91,10 +91,6 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#define DRV_NAME "8139too" -#define DRV_VERSION "0.9.28" - -#include <linux/module.h> #include <linux/kernel.h> #include <linux/compiler.h>
@@ -115,8 +111,6 @@#include <linux/if_vlan.h> #include <asm/irq.h> -#define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION -/* Default Message level */ #define RTL8139_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ NETIF_MSG_PROBE | \
@@ -623,7 +617,6 @@ struct rtl8139_private {MODULE_AUTHOR ("Jeff Garzik <[email protected]>" );MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION );module_param (use_io, bool,0 );MODULE_PARM_DESC (use_io,"Force use of I/O access mode. 0=MMIO 1=PIO" );
@@ -788,7 +781,7 @@ static struct net_device *rtl8139_init_board(struct pci_dev *pdev) goto err_out; disable_dev_on_err =1 ; - rc =pci_request_regions (pdev,DRV_NAME ); + rc =pci_request_regions (pdev,KBUILD_MODNAME );if (rc) goto err_out;
@@ -955,17 +948,6 @@ static int rtl8139_init_one(struct pci_dev *pdev, board_idx++; -/* when we're built into the kernel, the driver version message -* is only printed if at least one 8139 board has been found -*/ -#ifndef MODULE - { -static int printed_version; -if (!printed_version++) -pr_info (RTL8139_DRIVER_NAME "\n" ); - } -#endif -if (pdev->vendor ==PCI_VENDOR_ID_REALTEK && pdev->device ==PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >=0x20 ) { dev_info(&pdev->dev,
@@ -2382,8 +2364,7 @@ static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)static void rtl8139_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) {struct rtl8139_private *tp =netdev_priv (dev); -strscpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strscpy (info->version,DRV_VERSION ,sizeof (info->version)); +strscpy (info->driver,KBUILD_MODNAME ,sizeof (info->driver));strscpy (info->bus_info,pci_name (tp->pci_dev),sizeof (info->bus_info)); }
@@ -2649,32 +2630,11 @@ static int __maybe_unused rtl8139_resume(struct device *device) static SIMPLE_DEV_PM_OPS(rtl8139_pm_ops, rtl8139_suspend, rtl8139_resume);static struct pci_driver rtl8139_pci_driver = { - .name =DRV_NAME , + .name =KBUILD_MODNAME , .id_table = rtl8139_pci_tbl, .probe = rtl8139_init_one, .remove = rtl8139_remove_one, .driver.pm = &rtl8139_pm_ops, }; - -static int __init rtl8139_init_module (void ) -{ -/* when we're a module, we always print a version message, -* even if no 8139 board is found. -*/ -#ifdef MODULE -pr_info (RTL8139_DRIVER_NAME "\n" ); -#endif - -return pci_register_driver (&rtl8139_pci_driver); -} - - -static void __exit rtl8139_cleanup_module (void) -{ -pci_unregister_driver (&rtl8139_pci_driver); -} - - -module_init (rtl8139_init_module); -module_exit (rtl8139_cleanup_module); +module_pci_driver (rtl8139_pci_driver);
Signature · 1 line
2.43.0
PATCH 1/1 sis900: remove module version and switch to module_pci_driver
In reply to Ethan Nelson-MooreThe module version is useless, and the only thing the sis900_init_module routine did besides pci_register_driver was to print the version.
--- drivers/net/ethernet/sis/sis900.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-)
drivers/net/ethernet/sis/sis900.c +1 -30
@@ -79,10 +79,6 @@#include "sis900.h" #define SIS900_MODULE_NAME "sis900" -#define SIS900_DRV_VERSION "v1.08.10 Apr. 2 2006" - -static const char version[] = -KERN_INFO "sis900.c: " SIS900_DRV_VERSION "\n" ;static int max_interrupt_work =40 ;static int multicast_filter_limit =128 ;
@@ -442,13 +438,6 @@ static int sis900_probe(struct pci_dev *pci_dev,const char *card_name = card_names[pci_id->driver_data];const char *dev_name =pci_name (pci_dev); -/* when built into the kernel, we only print version if device is found */ -#ifndef MODULE -static int printed_version; -if (!printed_version++) -printk (version); -#endif -/* setup various bits in PCI command register */ ret =pcim_enable_device (pci_dev);if (ret)return ret;
@@ -2029,7 +2018,6 @@ static void sis900_get_drvinfo(struct net_device *net_dev,struct sis900_private *sis_priv =netdev_priv (net_dev);strscpy (info->driver,SIS900_MODULE_NAME ,sizeof (info->driver)); -strscpy (info->version,SIS900_DRV_VERSION ,sizeof (info->version));strscpy (info->bus_info,pci_name (sis_priv->pci_dev),sizeof (info->bus_info)); }
@@ -2567,21 +2555,4 @@ static struct pci_driver sis900_pci_driver = { .driver.pm = &sis900_pm_ops, }; -static int __init sis900_init_module (void ) -{ -/* when a module, this is printed whether or not devices are found in probe */ -#ifdef MODULE -printk (version); -#endif - -return pci_register_driver (&sis900_pci_driver); -} - -static void __exit sis900_cleanup_module(void) -{ -pci_unregister_driver (&sis900_pci_driver); -} - -module_init (sis900_init_module); -module_exit (sis900_cleanup_module); - +module_pci_driver (sis900_pci_driver);
Signature · 1 line
2.43.0
Quoted 2 lines · Ethan Nelson-Moore
The module version is useless, and the only thing the
epic_initroutine did besidespci_register_driverwas to print the version.
Hi Ethan
The threading is a bit odd in these series. Generally, for a patch series, each patch is numbered, 1/3, 2/3, 3/3 etc. And it is a good idea to have a 0/3 explaining the big picture of what the series does.
Andrew
Quoted 2 lines · Ethan Nelson-Moore
The module version is useless, and the only thing the
epic_initroutine did besidespci_register_driverwas to print the version.
You also failed to run ./scripts/get_maintainers.py, so you have lots of missing Cc:.
Andrew
---
pw-bot: cr