of_mdio: kill useless variable in of_mdiobus_register()
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 28 Feb 2016 18:56:34 +0000 (21:56 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Mar 2016 22:41:22 +0000 (17:41 -0500)
of_mdiobus_register()  declares the 'paddr' variable to hold the result of
the of_get_property()  but only uses it once after that while the function
can be called directly from the *if* statement. Remove that variable and
switch to calling of_find_property() instead since  we don't care about
the "reg" property's value anyway...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_mdio.c

index 39c4be41ef83d6cf23302fb9af6270f8857f85de..669739b302b2c584fc0f3072aed8c9c245157c0c 100644 (file)
@@ -211,7 +211,6 @@ static bool of_mdiobus_child_is_phy(struct device_node *child)
 int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 {
        struct device_node *child;
-       const __be32 *paddr;
        bool scanphys = false;
        int addr, rc;
 
@@ -246,8 +245,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
        /* auto scan for PHYs with empty reg property */
        for_each_available_child_of_node(np, child) {
                /* Skip PHYs with reg property set */
-               paddr = of_get_property(child, "reg", NULL);
-               if (paddr)
+               if (of_find_property(child, "reg", NULL))
                        continue;
 
                for (addr = 0; addr < PHY_MAX_ADDR; addr++) {