Skip to content

Commit 2765305

Browse files
committed
Merge branch 'mdio_net'
Johan Hovold says: ==================== net: cpsw and mdio-gpio fixes for v3.15-final These patches against v3.15-rc4 fix a few issues in the cpsw and mdio-gpio drivers. Resend with proper stable CC (git send-email still fails to parse the Sorry about the noise. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 6b5eeb7 + 60e71ab commit 2765305

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Documentation/devicetree/bindings/net/mdio-gpio.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ node.
1414
Example:
1515

1616
aliases {
17-
mdio-gpio0 = <&mdio0>;
17+
mdio-gpio0 = &mdio0;
1818
};
1919

2020
mdio0: mdio {

drivers/net/ethernet/ti/cpsw.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,18 +1871,13 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
18711871
mdio_node = of_find_node_by_phandle(be32_to_cpup(parp));
18721872
phyid = be32_to_cpup(parp+1);
18731873
mdio = of_find_device_by_node(mdio_node);
1874-
1875-
if (strncmp(mdio->name, "gpio", 4) == 0) {
1876-
/* GPIO bitbang MDIO driver attached */
1877-
struct mii_bus *bus = dev_get_drvdata(&mdio->dev);
1878-
1879-
snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
1880-
PHY_ID_FMT, bus->id, phyid);
1881-
} else {
1882-
/* davinci MDIO driver attached */
1883-
snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
1884-
PHY_ID_FMT, mdio->name, phyid);
1874+
of_node_put(mdio_node);
1875+
if (!mdio) {
1876+
pr_err("Missing mdio platform device\n");
1877+
return -EINVAL;
18851878
}
1879+
snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
1880+
PHY_ID_FMT, mdio->name, phyid);
18861881

18871882
mac_addr = of_get_mac_address(slave_node);
18881883
if (mac_addr)

drivers/net/phy/mdio-gpio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ static int mdio_gpio_probe(struct platform_device *pdev)
215215
if (pdev->dev.of_node) {
216216
pdata = mdio_gpio_of_get_data(pdev);
217217
bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio");
218+
if (bus_id < 0) {
219+
dev_warn(&pdev->dev, "failed to get alias id\n");
220+
bus_id = 0;
221+
}
218222
} else {
219223
pdata = dev_get_platdata(&pdev->dev);
220224
bus_id = pdev->id;

0 commit comments

Comments
 (0)