Skip to content

Commit 2513974

Browse files
committed
Merge branch 'stmmac-bug-fixes'
Yanteng Si says: ==================== stmmac: Some bug fixes * Put Krzysztof's patch into my thread, pick Conor's Reviewed-by tag and Jiaxun's Acked-by tag.(prev version is RFC patch) * I fixed an Oops related to mdio, mainly to ensure that mdio is initialized before use, because it will be used in a series of patches I am working on. see <https://lore.kernel.org/loongarch/[email protected]/T/#t> ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f3f32a3 + 4907a3f commit 2513974

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@
130130
compatible = "pci0014,7a03.0",
131131
"pci0014,7a03",
132132
"pciclass0c0320",
133-
"pciclass0c03",
134-
"loongson, pci-gmac";
133+
"pciclass0c03";
135134

136135
reg = <0x1800 0x0 0x0 0x0 0x0>;
137136
interrupts = <12 IRQ_TYPE_LEVEL_LOW>,

arch/mips/boot/dts/loongson/ls7a-pch.dtsi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@
193193
compatible = "pci0014,7a03.0",
194194
"pci0014,7a03",
195195
"pciclass020000",
196-
"pciclass0200",
197-
"loongson, pci-gmac";
196+
"pciclass0200";
198197

199198
reg = <0x1800 0x0 0x0 0x0 0x0>;
200199
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,19 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
5959
return -ENODEV;
6060
}
6161

62-
if (!of_device_is_compatible(np, "loongson, pci-gmac")) {
63-
pr_info("dwmac_loongson_pci: Incompatible OF node\n");
64-
return -ENODEV;
65-
}
66-
6762
plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
6863
if (!plat)
6964
return -ENOMEM;
7065

66+
plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
67+
sizeof(*plat->mdio_bus_data),
68+
GFP_KERNEL);
69+
if (!plat->mdio_bus_data)
70+
return -ENOMEM;
71+
7172
plat->mdio_node = of_get_child_by_name(np, "mdio");
7273
if (plat->mdio_node) {
7374
dev_info(&pdev->dev, "Found MDIO subnode\n");
74-
75-
plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
76-
sizeof(*plat->mdio_bus_data),
77-
GFP_KERNEL);
78-
if (!plat->mdio_bus_data) {
79-
ret = -ENOMEM;
80-
goto err_put_node;
81-
}
8275
plat->mdio_bus_data->needs_reset = true;
8376
}
8477

0 commit comments

Comments
 (0)