ACPI: sysfs: evaluate _STR on each sysfs access
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 9 Jul 2024 20:37:25 +0000 (22:37 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Aug 2024 14:44:22 +0000 (16:44 +0200)
commit52831d9bbc9aa029aed525dfbe61cb78c1db991c
tree844870d0d4ba3a1ce7298bbdfef4daa959a2ca51
parent4bb1e7d027413835b086aed35bc3f0713bc0f72b
ACPI: sysfs: evaluate _STR on each sysfs access

The handling of the _STR method is inconsistent with the other method
evaluations. It is the only method which is cached.

The cached value stored in 'struct acpi_device_pnp' has a different
lifetime than the other struct members.

Commit d1efe3c324ea ("ACPI: Add new sysfs interface to export device description")
does not explain this difference.

Evaluating the method every time also removes the necessity to manage
the lifetime of the cached value, which would be a problem when managing
the sysfs attributes through the device core.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20240709-acpi-sysfs-groups-v2-2-058ab0667fa8@weissschuh.net
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_sysfs.c
include/acpi/acpi_bus.h