diff mbox series

[v6,19/22] ACPI: platform_profile: Notify class device from platform_profile_notify()

Message ID 20241109044151.29804-20-mario.limonciello@amd.com (mailing list archive)
State Superseded, archived
Headers show
Series Add support for binding ACPI platform profile to multiple drivers | expand

Commit Message

Mario Limonciello Nov. 9, 2024, 4:41 a.m. UTC
When a driver has called platform_profile_notify() both the legacy sysfs
interface and the class device should be notified as userspace may listen
to either.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/acpi/platform_profile.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Armin Wolf Nov. 17, 2024, 7:26 p.m. UTC | #1
Am 09.11.24 um 05:41 schrieb Mario Limonciello:

> When a driver has called platform_profile_notify() both the legacy sysfs
> interface and the class device should be notified as userspace may listen
> to either.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/acpi/platform_profile.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index c574483be4fd1..7ad473982ab11 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -417,6 +417,7 @@ void platform_profile_notify(struct platform_profile_handler *pprof)
>   {
>   	if (!cur_profile)
>   		return;
> +	_notify_class_profile(NULL, pprof);

You will need to supply the first argument ("dev") here or _notify_class_profile() will crash.

Thanks,
Armin Wolf

>   	sysfs_notify(acpi_kobj, NULL, "platform_profile");
>   }
>   EXPORT_SYMBOL_GPL(platform_profile_notify);
diff mbox series

Patch

diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index c574483be4fd1..7ad473982ab11 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -417,6 +417,7 @@  void platform_profile_notify(struct platform_profile_handler *pprof)
 {
 	if (!cur_profile)
 		return;
+	_notify_class_profile(NULL, pprof);
 	sysfs_notify(acpi_kobj, NULL, "platform_profile");
 }
 EXPORT_SYMBOL_GPL(platform_profile_notify);