X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH v2] platform/x86: wmi: Use ACPI device name in netlink event
@ 2024-01-21 20:08 Armin Wolf
  2024-01-22 11:29 ` Hans de Goede
  2024-01-24 11:10 ` Ilpo Järvinen
  0 siblings, 2 replies; 6+ messages in thread
From: Armin Wolf @ 2024-01-21 20:08 UTC (permalink / raw)
  To: hdegoede, ilpo.jarvinen; +Cc: platform-driver-x86, linux-kernel

The device name inside the ACPI netlink event is limited to
15 characters, so the WMI device name will get truncated.

This can be observed with kacpimon when receiving an event
from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":

	netlink:  9DBB5994-A997- 000000d0 00000000

Fix this by using the shorter device name from the ACPI
bus device instead. This still allows users to uniquely
identify the WMI device by using the notify id (0xd0).

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
Changes since v1:
- use acpi_dev_name() helper function
---
 drivers/platform/x86/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index a7cfcbf92432..c61860db66ed 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -1202,7 +1202,7 @@ static int wmi_notify_device(struct device *dev, void *data)
 	}

 	acpi_bus_generate_netlink_event(wblock->acpi_device->pnp.device_class,
-					dev_name(&wblock->dev.dev), *event, 0);
+					acpi_dev_name(wblock->acpi_device), *event, 0);

 	return -EBUSY;
 }
--
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-24 11:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 20:08 [PATCH v2] platform/x86: wmi: Use ACPI device name in netlink event Armin Wolf
2024-01-22 11:29 ` Hans de Goede
2024-01-22 12:47   ` Ilpo Järvinen
2024-01-22 15:03     ` Armin Wolf
2024-01-24 11:06       ` Hans de Goede
2024-01-24 11:10 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox