Skip to content

Commit

Permalink
net: ethoc: Remove unnecessary #ifdef CONFIG_OF
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tobias Klauser authored and David S. Miller committed Sep 9, 2015
1 parent 03679a1 commit 444c5f9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/net/ethernet/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,19 +1132,14 @@ 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,
"local-mac-address",
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
Expand Down

0 comments on commit 444c5f9

Please sign in to comment.