[PATCH v1 1/1] HID: nintendo: Use %pM format specifier for MAC addresses
From: Andy Shevchenko
Date: Wed Jun 03 2026 - 04:34:56 EST
Convert to %pM instead of using custom code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/hid/hid-nintendo.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 29008c2cc530..77b14dfdae86 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -2431,14 +2431,8 @@ static int joycon_read_info(struct joycon_ctlr *ctlr)
for (i = 4, j = 0; j < 6; i++, j++)
ctlr->mac_addr[j] = report->subcmd_reply.data[i];
- ctlr->mac_addr_str = devm_kasprintf(&ctlr->hdev->dev, GFP_KERNEL,
- "%02X:%02X:%02X:%02X:%02X:%02X",
- ctlr->mac_addr[0],
- ctlr->mac_addr[1],
- ctlr->mac_addr[2],
- ctlr->mac_addr[3],
- ctlr->mac_addr[4],
- ctlr->mac_addr[5]);
+ ctlr->mac_addr_str = devm_kasprintf(&ctlr->hdev->dev, GFP_KERNEL, "%pM",
+ ctlr->mac_addr);
if (!ctlr->mac_addr_str)
return -ENOMEM;
hid_info(ctlr->hdev, "controller MAC = %s\n", ctlr->mac_addr_str);
--
2.50.1