]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
platform/x86: dell-wmi-sysman: Use standard kobj_sysfs_ops
authorThomas Weißschuh <linux@weissschuh.net>
Mon, 23 Feb 2026 20:59:07 +0000 (21:59 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 2 Mar 2026 16:29:08 +0000 (18:29 +0200)
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>
Link: https://patch.msgid.link/20260223-sysfs-const-dell-wmi-sysman-v1-1-8a690884044e@weissschuh.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c

index 9dddab6c93975dc4e903b7e27a0b702745be0e04..6241f16fd3dae6ea1b531209fb91cf112205dc99 100644 (file)
@@ -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,
 };
 
 /**