Skip to content

Commit 24f28dd

Browse files
zonquedavem330
authored andcommitted
net: of_mdio: don't store the length of a property if we don't need to
of_get_property() can be called with NULL as 2nd argument if the caller is not interested in the length of a property. Use that here so we can get rid of a variable. Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 86f6cf4 commit 24f28dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/of/of_mdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
123123
const __be32 *paddr;
124124
u32 addr;
125125
bool scanphys = false;
126-
int rc, i, len;
126+
int rc, i;
127127

128128
/* Mask out all PHYs from auto probing. Instead the PHYs listed in
129129
* the device tree are populated after the bus has been registered */
@@ -160,7 +160,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
160160
/* auto scan for PHYs with empty reg property */
161161
for_each_available_child_of_node(np, child) {
162162
/* Skip PHYs with reg property set */
163-
paddr = of_get_property(child, "reg", &len);
163+
paddr = of_get_property(child, "reg", NULL);
164164
if (paddr)
165165
continue;
166166

0 commit comments

Comments
 (0)