Skip to content

Commit 00371a3

Browse files
Philipp Stannerkuba-moo
authored andcommitted
stmmac: loongson: Pass correct arg to PCI function
pcim_iomap_regions() should receive the driver's name as its third parameter, not the PCI device's name. Define the driver name with a macro and use it at the appropriate places, including pcim_iomap_regions(). Cc: [email protected] # v5.14+ Fixes: 30bba69 ("stmmac: pci: Add dwmac support for Loongson") Signed-off-by: Philipp Stanner <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Yanteng Si <[email protected]> Tested-by: Henry Chen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ada9ce4 commit 00371a3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include "dwmac_dma.h"
1212
#include "dwmac1000.h"
1313

14+
#define DRIVER_NAME "dwmac-loongson-pci"
15+
1416
/* Normal Loongson Tx Summary */
1517
#define DMA_INTR_ENA_NIE_TX_LOONGSON 0x00040000
1618
/* Normal Loongson Rx Summary */
@@ -568,7 +570,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
568570
for (i = 0; i < PCI_STD_NUM_BARS; i++) {
569571
if (pci_resource_len(pdev, i) == 0)
570572
continue;
571-
ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
573+
ret = pcim_iomap_regions(pdev, BIT(0), DRIVER_NAME);
572574
if (ret)
573575
goto err_disable_device;
574576
break;
@@ -687,7 +689,7 @@ static const struct pci_device_id loongson_dwmac_id_table[] = {
687689
MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table);
688690

689691
static struct pci_driver loongson_dwmac_driver = {
690-
.name = "dwmac-loongson-pci",
692+
.name = DRIVER_NAME,
691693
.id_table = loongson_dwmac_id_table,
692694
.probe = loongson_dwmac_probe,
693695
.remove = loongson_dwmac_remove,

0 commit comments

Comments
 (0)