Skip to content

Commit 39ebe7a

Browse files
committed
ACPI: platform_profile: Clean platform_profile_handler
JIRA: https://issues.redhat.com/browse/RHEL-89362 commit c4f7d25 Author: Kurt Borja <kuurtb@gmail.com> Date: Wed Jan 15 19:27:19 2025 -0500 Remove parent device *dev from platform_profile_handler, as it's no longer accessed directly. Rename class_dev -> dev. Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Kurt Borja <kuurtb@gmail.com> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca> Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca> Link: https://lore.kernel.org/r/20250116002721.75592-18-kuurtb@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent f2526ad commit 39ebe7a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

drivers/acpi/platform_profile.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
#include <linux/platform_profile.h>
1111
#include <linux/sysfs.h>
1212

13-
#define to_pprof_handler(d) (container_of(d, struct platform_profile_handler, class_dev))
13+
#define to_pprof_handler(d) (container_of(d, struct platform_profile_handler, dev))
1414

1515
static DEFINE_MUTEX(profile_lock);
1616

1717
struct platform_profile_handler {
1818
const char *name;
19-
struct device *dev;
20-
struct device class_dev;
19+
struct device dev;
2120
int minor;
2221
unsigned long choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)];
2322
unsigned long hidden_choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)];
@@ -96,8 +95,8 @@ static int _notify_class_profile(struct device *dev, void *data)
9695
struct platform_profile_handler *handler = to_pprof_handler(dev);
9796

9897
lockdep_assert_held(&profile_lock);
99-
sysfs_notify(&handler->class_dev.kobj, NULL, "profile");
100-
kobject_uevent(&handler->class_dev.kobj, KOBJ_CHANGE);
98+
sysfs_notify(&handler->dev.kobj, NULL, "profile");
99+
kobject_uevent(&handler->dev.kobj, KOBJ_CHANGE);
101100

102101
return 0;
103102
}
@@ -569,12 +568,12 @@ struct device *platform_profile_register(struct device *dev, const char *name,
569568
pprof->name = name;
570569
pprof->ops = ops;
571570
pprof->minor = minor;
572-
pprof->class_dev.class = &platform_profile_class;
573-
pprof->class_dev.parent = dev;
574-
dev_set_drvdata(&pprof->class_dev, drvdata);
575-
dev_set_name(&pprof->class_dev, "platform-profile-%d", pprof->minor);
571+
pprof->dev.class = &platform_profile_class;
572+
pprof->dev.parent = dev;
573+
dev_set_drvdata(&pprof->dev, drvdata);
574+
dev_set_name(&pprof->dev, "platform-profile-%d", pprof->minor);
576575
/* device_register() takes ownership of pprof/ppdev */
577-
ppdev = &no_free_ptr(pprof)->class_dev;
576+
ppdev = &no_free_ptr(pprof)->dev;
578577
err = device_register(ppdev);
579578
if (err) {
580579
put_device(ppdev);
@@ -606,7 +605,7 @@ int platform_profile_remove(struct device *dev)
606605
guard(mutex)(&profile_lock);
607606

608607
id = pprof->minor;
609-
device_unregister(&pprof->class_dev);
608+
device_unregister(&pprof->dev);
610609
ida_free(&platform_profile_ida, id);
611610

612611
sysfs_notify(acpi_kobj, NULL, "platform_profile");

0 commit comments

Comments
 (0)