Skip to content

Commit b520bd0

Browse files
Sergei Shtylyovdavem330
authored andcommitted
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: Sergei Shtylyov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e760044 commit b520bd0

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

drivers/of/of_mdio.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ static int of_get_phy_id(struct device_node *device, u32 *phy_id)
4141
return -EINVAL;
4242
}
4343

44-
static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *child,
45-
u32 addr)
44+
static void of_mdiobus_register_phy(struct mii_bus *mdio,
45+
struct device_node *child, u32 addr)
4646
{
4747
struct phy_device *phy;
4848
bool is_c45;
@@ -57,7 +57,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
5757
else
5858
phy = get_phy_device(mdio, addr, is_c45);
5959
if (IS_ERR_OR_NULL(phy))
60-
return 1;
60+
return;
6161

6262
rc = irq_of_parse_and_map(child, 0);
6363
if (rc > 0) {
@@ -81,25 +81,22 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
8181
if (rc) {
8282
phy_device_free(phy);
8383
of_node_put(child);
84-
return 1;
84+
return;
8585
}
8686

8787
dev_dbg(&mdio->dev, "registered phy %s at address %i\n",
8888
child->name, addr);
89-
90-
return 0;
9189
}
9290

93-
static int of_mdiobus_register_device(struct mii_bus *mdio,
94-
struct device_node *child,
95-
u32 addr)
91+
static void of_mdiobus_register_device(struct mii_bus *mdio,
92+
struct device_node *child, u32 addr)
9693
{
9794
struct mdio_device *mdiodev;
9895
int rc;
9996

10097
mdiodev = mdio_device_create(mdio, addr);
10198
if (IS_ERR(mdiodev))
102-
return 1;
99+
return;
103100

104101
/* Associate the OF node with the device structure so it
105102
* can be looked up later.
@@ -112,13 +109,11 @@ static int of_mdiobus_register_device(struct mii_bus *mdio,
112109
if (rc) {
113110
mdio_device_free(mdiodev);
114111
of_node_put(child);
115-
return 1;
112+
return;
116113
}
117114

118115
dev_dbg(&mdio->dev, "registered mdio device %s at address %i\n",
119116
child->name, addr);
120-
121-
return 0;
122117
}
123118

124119
int of_mdio_parse_addr(struct device *dev, const struct device_node *np)

0 commit comments

Comments
 (0)