* [PATCH] of_mdio: kill useless variable in of_mdiobus_register()
@ 2016-02-28 18:56 Sergei Shtylyov
2016-03-01 22:42 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2016-02-28 18:56 UTC (permalink / raw)
To: grant.likely, robh+dt, devicetree, f.fainelli, netdev,
frowand.list
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>
---
The patch is against DaveM's 'net-next.git' repo.
drivers/of/of_mdio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Index: net-next/drivers/of/of_mdio.c
===================================================================
--- net-next.orig/drivers/of/of_mdio.c
+++ net-next/drivers/of/of_mdio.c
@@ -211,7 +211,6 @@ static bool of_mdiobus_child_is_phy(stru
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 *
/* 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++) {
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] of_mdio: kill useless variable in of_mdiobus_register()
2016-02-28 18:56 [PATCH] of_mdio: kill useless variable in of_mdiobus_register() Sergei Shtylyov
@ 2016-03-01 22:42 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-03-01 22:42 UTC (permalink / raw)
To: sergei.shtylyov
Cc: grant.likely, robh+dt, devicetree, f.fainelli, netdev,
frowand.list
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 28 Feb 2016 21:56:34 +0300
> 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>
>
> ---
> The patch is against DaveM's 'net-next.git' repo.
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-01 22:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-28 18:56 [PATCH] of_mdio: kill useless variable in of_mdiobus_register() Sergei Shtylyov
2016-03-01 22:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).