提交 27653053 编写于 作者: D David S. Miller

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: NDavid S. Miller <davem@davemloft.net>
...@@ -14,7 +14,7 @@ node. ...@@ -14,7 +14,7 @@ node.
Example: Example:
aliases { aliases {
mdio-gpio0 = <&mdio0>; mdio-gpio0 = &mdio0;
}; };
mdio0: mdio { mdio0: mdio {
......
...@@ -1871,18 +1871,13 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, ...@@ -1871,18 +1871,13 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
mdio_node = of_find_node_by_phandle(be32_to_cpup(parp)); mdio_node = of_find_node_by_phandle(be32_to_cpup(parp));
phyid = be32_to_cpup(parp+1); phyid = be32_to_cpup(parp+1);
mdio = of_find_device_by_node(mdio_node); mdio = of_find_device_by_node(mdio_node);
of_node_put(mdio_node);
if (strncmp(mdio->name, "gpio", 4) == 0) { if (!mdio) {
/* GPIO bitbang MDIO driver attached */ pr_err("Missing mdio platform device\n");
struct mii_bus *bus = dev_get_drvdata(&mdio->dev); return -EINVAL;
snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
PHY_ID_FMT, bus->id, phyid);
} else {
/* davinci MDIO driver attached */
snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
PHY_ID_FMT, mdio->name, phyid);
} }
snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
PHY_ID_FMT, mdio->name, phyid);
mac_addr = of_get_mac_address(slave_node); mac_addr = of_get_mac_address(slave_node);
if (mac_addr) if (mac_addr)
......
...@@ -215,6 +215,10 @@ static int mdio_gpio_probe(struct platform_device *pdev) ...@@ -215,6 +215,10 @@ static int mdio_gpio_probe(struct platform_device *pdev)
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
pdata = mdio_gpio_of_get_data(pdev); pdata = mdio_gpio_of_get_data(pdev);
bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio"); bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio");
if (bus_id < 0) {
dev_warn(&pdev->dev, "failed to get alias id\n");
bus_id = 0;
}
} else { } else {
pdata = dev_get_platdata(&pdev->dev); pdata = dev_get_platdata(&pdev->dev);
bus_id = pdev->id; bus_id = pdev->id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册