Skip to content

Commit 643607a

Browse files
Philipp Stannergregkh
authored andcommitted
stmmac: loongson: Pass correct arg to PCI function
[ Upstream commit 00371a3 ] 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: 30bba69 ("stmmac: pci: Add dwmac support for Loongson") Signed-off-by: Philipp Stanner <phasta@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Yanteng Si <si.yanteng@linux.dev> Tested-by: Henry Chen <chenx97@aosc.io> Link: https://patch.msgid.link/20250226085208.97891-2-phasta@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6653927 commit 643607a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
#include <linux/of_irq.h>
1010
#include "stmmac.h"
1111

12+
#define DRIVER_NAME "dwmac-loongson-pci"
13+
1214
static int loongson_default_data(struct plat_stmmacenet_data *plat)
15+
1316
{
1417
plat->clk_csr = 2; /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
1518
plat->has_gmac = 1;
@@ -95,7 +98,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
9598
for (i = 0; i < PCI_STD_NUM_BARS; i++) {
9699
if (pci_resource_len(pdev, i) == 0)
97100
continue;
98-
ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
101+
ret = pcim_iomap_regions(pdev, BIT(0), DRIVER_NAME);
99102
if (ret)
100103
goto err_disable_device;
101104
break;
@@ -222,7 +225,7 @@ static const struct pci_device_id loongson_dwmac_id_table[] = {
222225
MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table);
223226

224227
static struct pci_driver loongson_dwmac_driver = {
225-
.name = "dwmac-loongson-pci",
228+
.name = DRIVER_NAME,
226229
.id_table = loongson_dwmac_id_table,
227230
.probe = loongson_dwmac_probe,
228231
.remove = loongson_dwmac_remove,

0 commit comments

Comments
 (0)