提交 de6b08fd 编写于 作者: T Tobias Klauser 提交者: David S. Miller

net: ethoc: Use ether_addr_copy()

Use ether_addr_copy() instead of memcpy() to set netdev->dev_addr (which
is 2-byte aligned).
Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
Reviewed-by: NThierry Reding <thierry.reding@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0ed48440
......@@ -1148,14 +1148,14 @@ static int ethoc_probe(struct platform_device *pdev)
/* Allow the platform setup code to pass in a MAC address. */
if (pdata) {
memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN);
ether_addr_copy(netdev->dev_addr, pdata->hwaddr);
priv->phy_id = pdata->phy_id;
} else {
const void *mac;
mac = of_get_mac_address(pdev->dev.of_node);
if (mac)
memcpy(netdev->dev_addr, mac, IFHWADDRLEN);
ether_addr_copy(netdev->dev_addr, mac);
priv->phy_id = -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册