Skip to content
Snippets Groups Projects
Commit 00371a3f authored by Philipp Stanner's avatar Philipp Stanner Committed by Jakub Kicinski
Browse files

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: stable@vger.kernel.org # v5.14+
Fixes: 30bba69d ("stmmac: pci: Add dwmac support for Loongson")
Signed-off-by: default avatarPhilipp Stanner <phasta@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarYanteng Si <si.yanteng@linux.dev>
Tested-by: default avatarHenry Chen <chenx97@aosc.io>
Link: https://patch.msgid.link/20250226085208.97891-2-phasta@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ada9ce43
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "dwmac_dma.h" #include "dwmac_dma.h"
#include "dwmac1000.h" #include "dwmac1000.h"
#define DRIVER_NAME "dwmac-loongson-pci"
/* Normal Loongson Tx Summary */ /* Normal Loongson Tx Summary */
#define DMA_INTR_ENA_NIE_TX_LOONGSON 0x00040000 #define DMA_INTR_ENA_NIE_TX_LOONGSON 0x00040000
/* Normal Loongson Rx Summary */ /* Normal Loongson Rx Summary */
...@@ -568,7 +570,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id ...@@ -568,7 +570,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
for (i = 0; i < PCI_STD_NUM_BARS; i++) { for (i = 0; i < PCI_STD_NUM_BARS; i++) {
if (pci_resource_len(pdev, i) == 0) if (pci_resource_len(pdev, i) == 0)
continue; continue;
ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev)); ret = pcim_iomap_regions(pdev, BIT(0), DRIVER_NAME);
if (ret) if (ret)
goto err_disable_device; goto err_disable_device;
break; break;
...@@ -687,7 +689,7 @@ static const struct pci_device_id loongson_dwmac_id_table[] = { ...@@ -687,7 +689,7 @@ static const struct pci_device_id loongson_dwmac_id_table[] = {
MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table); MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table);
static struct pci_driver loongson_dwmac_driver = { static struct pci_driver loongson_dwmac_driver = {
.name = "dwmac-loongson-pci", .name = DRIVER_NAME,
.id_table = loongson_dwmac_id_table, .id_table = loongson_dwmac_id_table,
.probe = loongson_dwmac_probe, .probe = loongson_dwmac_probe,
.remove = loongson_dwmac_remove, .remove = loongson_dwmac_remove,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment