From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
To: netdev@vger.kernel.org
Cc: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Subject: [PATCH net-next] net: 8139too: switch to module_pci_driver; remove driver version
Date: Tue, 6 Jan 2026 23:10:14 -0800 [thread overview]
Message-ID: <20260107071015.29914-2-enelsonmoore@gmail.com> (raw)
In-Reply-To: <20260107071015.29914-1-enelsonmoore@gmail.com>
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.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
drivers/net/ethernet/realtek/8139too.c | 48 +++-----------------------
1 file changed, 4 insertions(+), 44 deletions(-)
diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
index a73dcaffa8c5..a22360185e63 100644
--- a/drivers/net/ethernet/realtek/8139too.c
+++ b/drivers/net/ethernet/realtek/8139too.c
@@ -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 <jgarzik@pobox.com>");
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);
--
2.43.0
next prev parent reply other threads:[~2026-01-07 7:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 7:10 [PATCH net-next] epic100: remove module version and switch to module_pci_driver Ethan Nelson-Moore
2026-01-07 7:10 ` Ethan Nelson-Moore [this message]
2026-01-07 7:10 ` [PATCH net-next] sis900: " Ethan Nelson-Moore
2026-01-07 17:43 ` [PATCH net-next] epic100: " Andrew Lunn
2026-01-07 17:44 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260107071015.29914-2-enelsonmoore@gmail.com \
--to=enelsonmoore@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.