* [PATCH] net: ethoc: Remove unnecessary #ifdef CONFIG_OF
@ 2015-09-09 9:24 Tobias Klauser
2015-09-09 21:16 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2015-09-09 9:24 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
For !CONFIG_OF of_get_property() is defined to always return NULL. Thus
there's no need to protect the call to of_get_property() with #ifdef
CONFIG_OF.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/net/ethernet/ethoc.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 442410c..a2c96fd 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -1132,10 +1132,6 @@ static int ethoc_probe(struct platform_device *pdev)
memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN);
priv->phy_id = pdata->phy_id;
} else {
- priv->phy_id = -1;
-
-#ifdef CONFIG_OF
- {
const uint8_t *mac;
mac = of_get_property(pdev->dev.of_node,
@@ -1143,8 +1139,7 @@ static int ethoc_probe(struct platform_device *pdev)
NULL);
if (mac)
memcpy(netdev->dev_addr, mac, IFHWADDRLEN);
- }
-#endif
+ priv->phy_id = -1;
}
/* Check that the given MAC address is valid. If it isn't, read the
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ethoc: Remove unnecessary #ifdef CONFIG_OF
2015-09-09 9:24 [PATCH] net: ethoc: Remove unnecessary #ifdef CONFIG_OF Tobias Klauser
@ 2015-09-09 21:16 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-09-09 21:16 UTC (permalink / raw)
To: tklauser; +Cc: netdev
From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 9 Sep 2015 11:24:29 +0200
> For !CONFIG_OF of_get_property() is defined to always return NULL. Thus
> there's no need to protect the call to of_get_property() with #ifdef
> CONFIG_OF.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-09 21:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-09 9:24 [PATCH] net: ethoc: Remove unnecessary #ifdef CONFIG_OF Tobias Klauser
2015-09-09 21:16 ` 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).