lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250115071022.4815-18-kuurtb@gmail.com>
Date: Wed, 15 Jan 2025 02:10:20 -0500
From: Kurt Borja <kuurtb@...il.com>
To: platform-driver-x86@...r.kernel.org
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
	"Len Brown" <lenb@...nel.org>,
	linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	"Mario Limonciello" <mario.limonciello@....com>,
	"Armin Wolf" <W_Armin@....de>,
	"Joshua Grisham" <josh@...huagrisham.com>,
	"Derek J. Clark" <derekjohn.clark@...il.com>,
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	"Hans de Goede" <hdegoede@...hat.com>,
	"Kurt Borja" <kuurtb@...il.com>,
	"Maximilian Luz" <luzmaximilian@...il.com>,
	"Lee, Chun-Yi" <jlee@...e.com>,
	"Shyam Sundar S K" <Shyam-sundar.S-k@....com>,
	"Corentin Chary" <corentin.chary@...il.com>,
	"Luke D. Jones" <luke@...nes.dev>,
	"Lyndon Sanche" <lsanche@...deno.ca>,
	"Ike Panhc" <ike.pan@...onical.com>,
	"Henrique de Moraes Holschuh" <hmh@....eng.br>,
	"Mark Pearson" <mpearson-lenovo@...ebb.ca>,
	"Alexis Belmonte" <alexbelm48@...il.com>,
	"Ai Chao" <aichao@...inos.cn>,
	"Gergo Koteles" <soyer@....hu>,
	Dell.Client.Kernel@...l.com,
	ibm-acpi-devel@...ts.sourceforge.net
Subject: [PATCH v3 17/19] 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 <mario.limonciello@....com>
Signed-off-by: Kurt Borja <kuurtb@...il.com>
---
 drivers/acpi/platform_profile.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index f27005a267a1..8a1454e66cf1 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -10,14 +10,13 @@
 #include <linux/platform_profile.h>
 #include <linux/sysfs.h>
 
-#define to_pprof_handler(d)	(container_of(d, struct platform_profile_handler, class_dev))
+#define to_pprof_handler(d)	(container_of(d, struct platform_profile_handler, dev))
 
 static DEFINE_MUTEX(profile_lock);
 
 struct platform_profile_handler {
 	const char *name;
-	struct device *dev;
-	struct device class_dev;
+	struct device dev;
 	int minor;
 	unsigned long choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)];
 	const struct platform_profile_ops *ops;
@@ -90,8 +89,8 @@ static int _notify_class_profile(struct device *dev, void *data)
 	struct platform_profile_handler *handler = to_pprof_handler(dev);
 
 	lockdep_assert_held(&profile_lock);
-	sysfs_notify(&handler->class_dev.kobj, NULL, "profile");
-	kobject_uevent(&handler->class_dev.kobj, KOBJ_CHANGE);
+	sysfs_notify(&handler->dev.kobj, NULL, "profile");
+	kobject_uevent(&handler->dev.kobj, KOBJ_CHANGE);
 
 	return 0;
 }
@@ -517,12 +516,12 @@ struct device *platform_profile_register(struct device *dev, const char *name,
 	pprof->name = name;
 	pprof->ops = ops;
 	pprof->minor = minor;
-	pprof->class_dev.class = &platform_profile_class;
-	pprof->class_dev.parent = dev;
-	dev_set_drvdata(&pprof->class_dev, drvdata);
-	dev_set_name(&pprof->class_dev, "platform-profile-%d", pprof->minor);
+	pprof->dev.class = &platform_profile_class;
+	pprof->dev.parent = dev;
+	dev_set_drvdata(&pprof->dev, drvdata);
+	dev_set_name(&pprof->dev, "platform-profile-%d", pprof->minor);
 	/* device_register() takes ownership of ppdev */
-	ppdev = &no_free_ptr(pprof)->class_dev;
+	ppdev = &no_free_ptr(pprof)->dev;
 	err = device_register(ppdev);
 	if (err) {
 		put_device(ppdev);
@@ -554,7 +553,7 @@ int platform_profile_remove(struct device *dev)
 	guard(mutex)(&profile_lock);
 
 	id = pprof->minor;
-	device_unregister(&pprof->class_dev);
+	device_unregister(&pprof->dev);
 	ida_free(&platform_profile_ida, id);
 
 	sysfs_notify(acpi_kobj, NULL, "platform_profile");
-- 
2.48.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ