mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-04 19:27:42 +01:00
realtek: rtl838x_eth: Use printk MAC specifier instead of raw hex
The linux kernel printk has a MAC address specifier `%pM` that can be used to pretty-print MAC addresses. We should use this specifier when printing MAC addresses for humans since that ensure the appearance that people are used to. Fixes #21796 Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21812 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
401ec439a2
commit
6d4e9c2d48
1 changed files with 2 additions and 4 deletions
|
|
@ -1302,7 +1302,6 @@ static void rteth_set_mac_hw(struct net_device *dev, u8 *mac)
|
|||
|
||||
static int rteth_set_mac_address(struct net_device *dev, void *p)
|
||||
{
|
||||
struct rteth_ctrl *ctrl = netdev_priv(dev);
|
||||
const struct sockaddr *addr = p;
|
||||
u8 *mac = (u8 *)(addr->sa_data);
|
||||
|
||||
|
|
@ -1312,7 +1311,7 @@ static int rteth_set_mac_address(struct net_device *dev, void *p)
|
|||
dev_addr_set(dev, addr->sa_data);
|
||||
rteth_set_mac_hw(dev, mac);
|
||||
|
||||
pr_info("Using MAC %08x%08x\n", sw_r32(ctrl->r->mac), sw_r32(ctrl->r->mac + 4));
|
||||
pr_info("Using MAC %pM\n", dev->dev_addr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1747,8 +1746,7 @@ static int rtl838x_eth_probe(struct platform_device *pdev)
|
|||
if (rteth_set_mac_address(dev, &sa))
|
||||
netdev_warn(dev, "Failed to set MAC address.\n");
|
||||
}
|
||||
pr_info("Using MAC %08x%08x\n", sw_r32(ctrl->r->mac),
|
||||
sw_r32(ctrl->r->mac + 4));
|
||||
pr_info("Using MAC %pM\n", dev->dev_addr);
|
||||
strscpy(dev->name, "eth%d", sizeof(dev->name));
|
||||
|
||||
ctrl->pdev = pdev;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue