|
@@ -37,6 +37,7 @@
|
|
#include <linux/of_device.h>
|
|
#include <linux/of_device.h>
|
|
#include <linux/of_irq.h>
|
|
#include <linux/of_irq.h>
|
|
#include <linux/of_mdio.h>
|
|
#include <linux/of_mdio.h>
|
|
|
|
+#include <linux/of_net.h>
|
|
#include <linux/of_platform.h>
|
|
#include <linux/of_platform.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/skbuff.h>
|
|
#include <linux/skbuff.h>
|
|
@@ -332,7 +333,7 @@ static void temac_do_set_mac_address(struct net_device *ndev)
|
|
mutex_unlock(&lp->indirect_mutex);
|
|
mutex_unlock(&lp->indirect_mutex);
|
|
}
|
|
}
|
|
|
|
|
|
-static int temac_init_mac_address(struct net_device *ndev, void *address)
|
|
|
|
|
|
+static int temac_init_mac_address(struct net_device *ndev, const void *address)
|
|
{
|
|
{
|
|
memcpy(ndev->dev_addr, address, ETH_ALEN);
|
|
memcpy(ndev->dev_addr, address, ETH_ALEN);
|
|
if (!is_valid_ether_addr(ndev->dev_addr))
|
|
if (!is_valid_ether_addr(ndev->dev_addr))
|
|
@@ -982,7 +983,7 @@ static int temac_of_probe(struct platform_device *op)
|
|
struct net_device *ndev;
|
|
struct net_device *ndev;
|
|
const void *addr;
|
|
const void *addr;
|
|
__be32 *p;
|
|
__be32 *p;
|
|
- int size, rc = 0;
|
|
|
|
|
|
+ int rc = 0;
|
|
|
|
|
|
/* Init network device structure */
|
|
/* Init network device structure */
|
|
ndev = alloc_etherdev(sizeof(*lp));
|
|
ndev = alloc_etherdev(sizeof(*lp));
|
|
@@ -1074,13 +1075,13 @@ static int temac_of_probe(struct platform_device *op)
|
|
|
|
|
|
|
|
|
|
/* Retrieve the MAC address */
|
|
/* Retrieve the MAC address */
|
|
- addr = of_get_property(op->dev.of_node, "local-mac-address", &size);
|
|
|
|
- if ((!addr) || (size != 6)) {
|
|
|
|
|
|
+ addr = of_get_mac_address(op->dev.of_node);
|
|
|
|
+ if (!addr) {
|
|
dev_err(&op->dev, "could not find MAC address\n");
|
|
dev_err(&op->dev, "could not find MAC address\n");
|
|
rc = -ENODEV;
|
|
rc = -ENODEV;
|
|
goto err_iounmap_2;
|
|
goto err_iounmap_2;
|
|
}
|
|
}
|
|
- temac_init_mac_address(ndev, (void *)addr);
|
|
|
|
|
|
+ temac_init_mac_address(ndev, addr);
|
|
|
|
|
|
rc = temac_mdio_setup(lp, op->dev.of_node);
|
|
rc = temac_mdio_setup(lp, op->dev.of_node);
|
|
if (rc)
|
|
if (rc)
|