cndm: Replace DRIVER_NAME with KBUILD_MODNAME

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich
2026-01-01 21:41:45 -08:00
parent d554f45b22
commit b8cd443e01
3 changed files with 5 additions and 6 deletions

View File

@@ -19,7 +19,6 @@ Authors:
#include <linux/ptp_clock_kernel.h> #include <linux/ptp_clock_kernel.h>
#include <net/devlink.h> #include <net/devlink.h>
#define DRIVER_NAME "cndm"
#define DRIVER_VERSION "0.1" #define DRIVER_VERSION "0.1"
#define CNDM_MAX_IRQ 256 #define CNDM_MAX_IRQ 256

View File

@@ -18,7 +18,7 @@ static void cndm_get_drvinfo(struct net_device *ndev,
struct cndm_priv *priv = netdev_priv(ndev); struct cndm_priv *priv = netdev_priv(ndev);
struct cndm_dev *cdev = priv->cdev; struct cndm_dev *cdev = priv->cdev;
strscpy(drvinfo->driver, DRIVER_NAME, sizeof(drvinfo->driver)); strscpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver));
strscpy(drvinfo->version, DRIVER_VERSION, sizeof(drvinfo->version)); strscpy(drvinfo->version, DRIVER_VERSION, sizeof(drvinfo->version));
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "TODO"); // TODO snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "TODO"); // TODO
strscpy(drvinfo->bus_info, dev_name(cdev->dev), sizeof(drvinfo->bus_info)); strscpy(drvinfo->bus_info, dev_name(cdev->dev), sizeof(drvinfo->bus_info));

View File

@@ -27,7 +27,7 @@ static int cndm_assign_id(struct cndm_dev *cdev)
return ret; return ret;
cdev->id = ret; cdev->id = ret;
snprintf(cdev->name, sizeof(cdev->name), DRIVER_NAME "%d", cdev->id); snprintf(cdev->name, sizeof(cdev->name), KBUILD_MODNAME "%d", cdev->id);
return 0; return 0;
} }
@@ -121,7 +121,7 @@ static int cndm_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct pci_dev *bridge = pci_upstream_bridge(pdev); struct pci_dev *bridge = pci_upstream_bridge(pdev);
int ret = 0; int ret = 0;
dev_info(dev, DRIVER_NAME " PCI probe"); dev_info(dev, KBUILD_MODNAME " PCI probe");
dev_info(dev, "Corundum device driver"); dev_info(dev, "Corundum device driver");
dev_info(dev, "Version " DRIVER_VERSION); dev_info(dev, "Version " DRIVER_VERSION);
dev_info(dev, "Copyright (c) 2025 FPGA Ninja, LLC"); dev_info(dev, "Copyright (c) 2025 FPGA Ninja, LLC");
@@ -264,7 +264,7 @@ static void cndm_pci_remove(struct pci_dev *pdev)
struct cndm_dev *cdev = pci_get_drvdata(pdev); struct cndm_dev *cdev = pci_get_drvdata(pdev);
struct devlink *devlink = priv_to_devlink(cdev); struct devlink *devlink = priv_to_devlink(cdev);
dev_info(dev, DRIVER_NAME " PCI remove"); dev_info(dev, KBUILD_MODNAME " PCI remove");
cndm_common_remove(cdev); cndm_common_remove(cdev);
@@ -284,7 +284,7 @@ static const struct pci_device_id cndm_pci_id_table[] = {
}; };
static struct pci_driver cndm_driver = { static struct pci_driver cndm_driver = {
.name = DRIVER_NAME, .name = KBUILD_MODNAME,
.id_table = cndm_pci_id_table, .id_table = cndm_pci_id_table,
.probe = cndm_pci_probe, .probe = cndm_pci_probe,
.remove = cndm_pci_remove .remove = cndm_pci_remove