Commit b520bd07 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

of_mdio: make of_mdiobus_register_{device|phy}() *void*

The results of of_mdiobus_register_{device|phy}() are never checked, so we
can make  both these functions *void*...
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7600449
...@@ -41,8 +41,8 @@ static int of_get_phy_id(struct device_node *device, u32 *phy_id) ...@@ -41,8 +41,8 @@ static int of_get_phy_id(struct device_node *device, u32 *phy_id)
return -EINVAL; return -EINVAL;
} }
static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *child, static void of_mdiobus_register_phy(struct mii_bus *mdio,
u32 addr) struct device_node *child, u32 addr)
{ {
struct phy_device *phy; struct phy_device *phy;
bool is_c45; bool is_c45;
...@@ -57,7 +57,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi ...@@ -57,7 +57,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
else else
phy = get_phy_device(mdio, addr, is_c45); phy = get_phy_device(mdio, addr, is_c45);
if (IS_ERR_OR_NULL(phy)) if (IS_ERR_OR_NULL(phy))
return 1; return;
rc = irq_of_parse_and_map(child, 0); rc = irq_of_parse_and_map(child, 0);
if (rc > 0) { if (rc > 0) {
...@@ -81,25 +81,22 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi ...@@ -81,25 +81,22 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
if (rc) { if (rc) {
phy_device_free(phy); phy_device_free(phy);
of_node_put(child); of_node_put(child);
return 1; return;
} }
dev_dbg(&mdio->dev, "registered phy %s at address %i\n", dev_dbg(&mdio->dev, "registered phy %s at address %i\n",
child->name, addr); child->name, addr);
return 0;
} }
static int of_mdiobus_register_device(struct mii_bus *mdio, static void of_mdiobus_register_device(struct mii_bus *mdio,
struct device_node *child, struct device_node *child, u32 addr)
u32 addr)
{ {
struct mdio_device *mdiodev; struct mdio_device *mdiodev;
int rc; int rc;
mdiodev = mdio_device_create(mdio, addr); mdiodev = mdio_device_create(mdio, addr);
if (IS_ERR(mdiodev)) if (IS_ERR(mdiodev))
return 1; return;
/* Associate the OF node with the device structure so it /* Associate the OF node with the device structure so it
* can be looked up later. * can be looked up later.
...@@ -112,13 +109,11 @@ static int of_mdiobus_register_device(struct mii_bus *mdio, ...@@ -112,13 +109,11 @@ static int of_mdiobus_register_device(struct mii_bus *mdio,
if (rc) { if (rc) {
mdio_device_free(mdiodev); mdio_device_free(mdiodev);
of_node_put(child); of_node_put(child);
return 1; return;
} }
dev_dbg(&mdio->dev, "registered mdio device %s at address %i\n", dev_dbg(&mdio->dev, "registered mdio device %s at address %i\n",
child->name, addr); child->name, addr);
return 0;
} }
int of_mdio_parse_addr(struct device *dev, const struct device_node *np) int of_mdio_parse_addr(struct device *dev, const struct device_node *np)
......
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