Commit 2513974c authored by David S. Miller's avatar David S. Miller

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/cover.1699533745.git.siyanteng@loongson.cn/T/#t>
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f3f32a35 4907a3f5
...@@ -130,8 +130,7 @@ gmac@3,0 { ...@@ -130,8 +130,7 @@ gmac@3,0 {
compatible = "pci0014,7a03.0", compatible = "pci0014,7a03.0",
"pci0014,7a03", "pci0014,7a03",
"pciclass0c0320", "pciclass0c0320",
"pciclass0c03", "pciclass0c03";
"loongson, pci-gmac";
reg = <0x1800 0x0 0x0 0x0 0x0>; reg = <0x1800 0x0 0x0 0x0 0x0>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>, interrupts = <12 IRQ_TYPE_LEVEL_LOW>,
......
...@@ -193,8 +193,7 @@ gmac@3,0 { ...@@ -193,8 +193,7 @@ gmac@3,0 {
compatible = "pci0014,7a03.0", compatible = "pci0014,7a03.0",
"pci0014,7a03", "pci0014,7a03",
"pciclass020000", "pciclass020000",
"pciclass0200", "pciclass0200";
"loongson, pci-gmac";
reg = <0x1800 0x0 0x0 0x0 0x0>; reg = <0x1800 0x0 0x0 0x0 0x0>;
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>, interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
......
...@@ -59,26 +59,19 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id ...@@ -59,26 +59,19 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
return -ENODEV; return -ENODEV;
} }
if (!of_device_is_compatible(np, "loongson, pci-gmac")) {
pr_info("dwmac_loongson_pci: Incompatible OF node\n");
return -ENODEV;
}
plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
if (!plat) if (!plat)
return -ENOMEM; return -ENOMEM;
plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
sizeof(*plat->mdio_bus_data),
GFP_KERNEL);
if (!plat->mdio_bus_data)
return -ENOMEM;
plat->mdio_node = of_get_child_by_name(np, "mdio"); plat->mdio_node = of_get_child_by_name(np, "mdio");
if (plat->mdio_node) { if (plat->mdio_node) {
dev_info(&pdev->dev, "Found MDIO subnode\n"); dev_info(&pdev->dev, "Found MDIO subnode\n");
plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
sizeof(*plat->mdio_bus_data),
GFP_KERNEL);
if (!plat->mdio_bus_data) {
ret = -ENOMEM;
goto err_put_node;
}
plat->mdio_bus_data->needs_reset = true; plat->mdio_bus_data->needs_reset = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment