提交 74afa306 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

net: fec_mpc52xx: don't discard const from netdev->dev_addr

Recent changes made netdev->dev_addr const, and it's passed
directly to mpc52xx_fec_set_paddr().

Similar problem exists on the probe patch, the driver needs
to call eth_hw_addr_set().
Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Fixes: adeef3e3 ("net: constify netdev->dev_addr")
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c63003e3
......@@ -99,13 +99,13 @@ static void mpc52xx_fec_tx_timeout(struct net_device *dev, unsigned int txqueue)
netif_wake_queue(dev);
}
static void mpc52xx_fec_set_paddr(struct net_device *dev, u8 *mac)
static void mpc52xx_fec_set_paddr(struct net_device *dev, const u8 *mac)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
struct mpc52xx_fec __iomem *fec = priv->fec;
out_be32(&fec->paddr1, *(u32 *)(&mac[0]));
out_be32(&fec->paddr2, (*(u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE);
out_be32(&fec->paddr1, *(const u32 *)(&mac[0]));
out_be32(&fec->paddr2, (*(const u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE);
}
static int mpc52xx_fec_set_mac_address(struct net_device *dev, void *addr)
......@@ -893,13 +893,15 @@ static int mpc52xx_fec_probe(struct platform_device *op)
rv = of_get_ethdev_address(np, ndev);
if (rv) {
struct mpc52xx_fec __iomem *fec = priv->fec;
u8 addr[ETH_ALEN] __aligned(4);
/*
* If the MAC addresse is not provided via DT then read
* it back from the controller regs
*/
*(u32 *)(&ndev->dev_addr[0]) = in_be32(&fec->paddr1);
*(u16 *)(&ndev->dev_addr[4]) = in_be32(&fec->paddr2) >> 16;
*(u32 *)(&addr[0]) = in_be32(&fec->paddr1);
*(u16 *)(&addr[4]) = in_be32(&fec->paddr2) >> 16;
eth_hw_addr_set(ndev, addr);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册