Skip to content

Commit daaa2a1

Browse files
t-8chjwrdegoede
authored andcommitted
platform/x86: think-lmi: Remove custom kobject sysfs_ops
think-lmi defines its own sysfs_ops that are identical to the standard kobj_sysfs_ops. Use the standard definitions. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent da62908 commit daaa2a1

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

drivers/platform/x86/think-lmi.c

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,33 +1047,6 @@ static const struct attribute_group tlmi_attr_group = {
10471047
.attrs = tlmi_attrs,
10481048
};
10491049

1050-
static ssize_t tlmi_attr_show(struct kobject *kobj, struct attribute *attr,
1051-
char *buf)
1052-
{
1053-
struct kobj_attribute *kattr;
1054-
1055-
kattr = container_of(attr, struct kobj_attribute, attr);
1056-
if (kattr->show)
1057-
return kattr->show(kobj, kattr, buf);
1058-
return -EIO;
1059-
}
1060-
1061-
static ssize_t tlmi_attr_store(struct kobject *kobj, struct attribute *attr,
1062-
const char *buf, size_t count)
1063-
{
1064-
struct kobj_attribute *kattr;
1065-
1066-
kattr = container_of(attr, struct kobj_attribute, attr);
1067-
if (kattr->store)
1068-
return kattr->store(kobj, kattr, buf, count);
1069-
return -EIO;
1070-
}
1071-
1072-
static const struct sysfs_ops tlmi_kobj_sysfs_ops = {
1073-
.show = tlmi_attr_show,
1074-
.store = tlmi_attr_store,
1075-
};
1076-
10771050
static void tlmi_attr_setting_release(struct kobject *kobj)
10781051
{
10791052
struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj);
@@ -1091,12 +1064,12 @@ static void tlmi_pwd_setting_release(struct kobject *kobj)
10911064

10921065
static const struct kobj_type tlmi_attr_setting_ktype = {
10931066
.release = &tlmi_attr_setting_release,
1094-
.sysfs_ops = &tlmi_kobj_sysfs_ops,
1067+
.sysfs_ops = &kobj_sysfs_ops,
10951068
};
10961069

10971070
static const struct kobj_type tlmi_pwd_setting_ktype = {
10981071
.release = &tlmi_pwd_setting_release,
1099-
.sysfs_ops = &tlmi_kobj_sysfs_ops,
1072+
.sysfs_ops = &kobj_sysfs_ops,
11001073
};
11011074

11021075
static ssize_t pending_reboot_show(struct kobject *kobj, struct kobj_attribute *attr,

0 commit comments

Comments
 (0)