Skip to content

Commit c4f7d25

Browse files
kuu-rtij-intel
authored andcommitted
ACPI: platform_profile: Clean platform_profile_handler
Remove parent device *dev from platform_profile_handler, as it's no longer accessed directly. Rename class_dev -> dev. Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Kurt Borja <[email protected]> Reviewed-by: Mark Pearson <[email protected]> Tested-by: Mark Pearson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 6ef3389 commit c4f7d25

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
const struct platform_profile_ops *ops;
@@ -90,8 +89,8 @@ static int _notify_class_profile(struct device *dev, void *data)
9089
struct platform_profile_handler *handler = to_pprof_handler(dev);
9190

9291
lockdep_assert_held(&profile_lock);
93-
sysfs_notify(&handler->class_dev.kobj, NULL, "profile");
94-
kobject_uevent(&handler->class_dev.kobj, KOBJ_CHANGE);
92+
sysfs_notify(&handler->dev.kobj, NULL, "profile");
93+
kobject_uevent(&handler->dev.kobj, KOBJ_CHANGE);
9594

9695
return 0;
9796
}
@@ -517,12 +516,12 @@ struct device *platform_profile_register(struct device *dev, const char *name,
517516
pprof->name = name;
518517
pprof->ops = ops;
519518
pprof->minor = minor;
520-
pprof->class_dev.class = &platform_profile_class;
521-
pprof->class_dev.parent = dev;
522-
dev_set_drvdata(&pprof->class_dev, drvdata);
523-
dev_set_name(&pprof->class_dev, "platform-profile-%d", pprof->minor);
519+
pprof->dev.class = &platform_profile_class;
520+
pprof->dev.parent = dev;
521+
dev_set_drvdata(&pprof->dev, drvdata);
522+
dev_set_name(&pprof->dev, "platform-profile-%d", pprof->minor);
524523
/* device_register() takes ownership of pprof/ppdev */
525-
ppdev = &no_free_ptr(pprof)->class_dev;
524+
ppdev = &no_free_ptr(pprof)->dev;
526525
err = device_register(ppdev);
527526
if (err) {
528527
put_device(ppdev);
@@ -554,7 +553,7 @@ int platform_profile_remove(struct device *dev)
554553
guard(mutex)(&profile_lock);
555554

556555
id = pprof->minor;
557-
device_unregister(&pprof->class_dev);
556+
device_unregister(&pprof->dev);
558557
ida_free(&platform_profile_ida, id);
559558

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

0 commit comments

Comments
 (0)