[PATCH] platform/x86: dell-wmi-sysman: Use standard kobj_sysfs_ops

Thomas Weißschuh posted 1 patch 1 month, 3 weeks ago
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 31 +---------------------
1 file changed, 1 insertion(+), 30 deletions(-)
[PATCH] platform/x86: dell-wmi-sysman: Use standard kobj_sysfs_ops
Posted by Thomas Weißschuh 1 month, 3 weeks ago
wmi_sysman_kobj_sysfs_ops are identical to the standard kobj_sysfs_ops.

Drop the unnecessary custom copy.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Only compile-tested.
---
 drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 31 +---------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
index 9dddab6c9397..6241f16fd3da 100644
--- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
+++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
@@ -220,35 +220,6 @@ static int create_attributes_level_sysfs_files(void)
 	return 0;
 }
 
-static ssize_t wmi_sysman_attr_show(struct kobject *kobj, struct attribute *attr,
-				    char *buf)
-{
-	struct kobj_attribute *kattr;
-	ssize_t ret = -EIO;
-
-	kattr = container_of(attr, struct kobj_attribute, attr);
-	if (kattr->show)
-		ret = kattr->show(kobj, kattr, buf);
-	return ret;
-}
-
-static ssize_t wmi_sysman_attr_store(struct kobject *kobj, struct attribute *attr,
-				     const char *buf, size_t count)
-{
-	struct kobj_attribute *kattr;
-	ssize_t ret = -EIO;
-
-	kattr = container_of(attr, struct kobj_attribute, attr);
-	if (kattr->store)
-		ret = kattr->store(kobj, kattr, buf, count);
-	return ret;
-}
-
-static const struct sysfs_ops wmi_sysman_kobj_sysfs_ops = {
-	.show	= wmi_sysman_attr_show,
-	.store	= wmi_sysman_attr_store,
-};
-
 static void attr_name_release(struct kobject *kobj)
 {
 	kfree(kobj);
@@ -256,7 +227,7 @@ static void attr_name_release(struct kobject *kobj)
 
 static const struct kobj_type attr_name_ktype = {
 	.release	= attr_name_release,
-	.sysfs_ops	= &wmi_sysman_kobj_sysfs_ops,
+	.sysfs_ops	= &kobj_sysfs_ops,
 };
 
 /**

---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260223-sysfs-const-dell-wmi-sysman-bc249ce82120

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH] platform/x86: dell-wmi-sysman: Use standard kobj_sysfs_ops
Posted by Ilpo Järvinen 1 month, 2 weeks ago
On Mon, 23 Feb 2026 21:59:07 +0100, Thomas Weißschuh wrote:

> wmi_sysman_kobj_sysfs_ops are identical to the standard kobj_sysfs_ops.
> 
> Drop the unnecessary custom copy.
> 
> 


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: dell-wmi-sysman: Use standard kobj_sysfs_ops
      commit: 1b0b124a9c41bf384f609003a97ba35a25fae130

--
 i.