Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'driver-core-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
"Here are two small driver core changes for 5.18-rc2.

They are the final bits in the removal of the default_attrs field in
struct kobj_type. I had to wait until after 5.18-rc1 for all of the
changes to do this came in through different development trees, and
then one new user snuck in. So this series has two changes:

- removal of the default_attrs field in the powerpc/pseries/vas code.

The change has been acked by the PPC maintainers to come through
this tree

- removal of default_attrs from struct kobj_type now that all
in-kernel users are removed.

This cleans up the kobject code a little bit and removes some
duplicated functionality that confused people (now there is only
one way to do default groups)

Both of these have been in linux-next for all of this week with no
reported problems"

* tag 'driver-core-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
kobject: kobj_type: remove default_attrs
powerpc/pseries/vas: use default_groups in kobj_type

+4 -48
+4 -2
arch/powerpc/platforms/pseries/vas-sysfs.c
··· 99 99 &nr_used_credits_attribute.attr, 100 100 NULL, 101 101 }; 102 + ATTRIBUTE_GROUPS(vas_def_capab); 102 103 103 104 static struct attribute *vas_qos_capab_attrs[] = { 104 105 &nr_total_credits_attribute.attr, ··· 107 106 &update_total_credits_attribute.attr, 108 107 NULL, 109 108 }; 109 + ATTRIBUTE_GROUPS(vas_qos_capab); 110 110 111 111 static ssize_t vas_type_show(struct kobject *kobj, struct attribute *attr, 112 112 char *buf) ··· 156 154 static struct kobj_type vas_def_attr_type = { 157 155 .release = vas_type_release, 158 156 .sysfs_ops = &vas_sysfs_ops, 159 - .default_attrs = vas_def_capab_attrs, 157 + .default_groups = vas_def_capab_groups, 160 158 }; 161 159 162 160 static struct kobj_type vas_qos_attr_type = { 163 161 .release = vas_type_release, 164 162 .sysfs_ops = &vas_sysfs_ops, 165 - .default_attrs = vas_qos_capab_attrs, 163 + .default_groups = vas_qos_capab_groups, 166 164 }; 167 165 168 166 static char *vas_caps_kobj_name(struct vas_caps_entry *centry,
-13
fs/sysfs/file.c
··· 703 703 704 704 ktype = get_ktype(kobj); 705 705 if (ktype) { 706 - struct attribute **kattr; 707 - 708 - /* 709 - * Change owner of the default attributes associated with the 710 - * ktype of @kobj. 711 - */ 712 - for (kattr = ktype->default_attrs; kattr && *kattr; kattr++) { 713 - error = sysfs_file_change_owner(kobj, (*kattr)->name, 714 - kuid, kgid); 715 - if (error) 716 - return error; 717 - } 718 - 719 706 /* 720 707 * Change owner of the default groups associated with the 721 708 * ktype of @kobj.
-1
include/linux/kobject.h
··· 120 120 struct kobj_type { 121 121 void (*release)(struct kobject *kobj); 122 122 const struct sysfs_ops *sysfs_ops; 123 - struct attribute **default_attrs; /* use default_groups instead */ 124 123 const struct attribute_group **default_groups; 125 124 const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj); 126 125 const void *(*namespace)(struct kobject *kobj);
-32
lib/kobject.c
··· 54 54 kobj->ktype->get_ownership(kobj, uid, gid); 55 55 } 56 56 57 - /* 58 - * populate_dir - populate directory with attributes. 59 - * @kobj: object we're working on. 60 - * 61 - * Most subsystems have a set of default attributes that are associated 62 - * with an object that registers with them. This is a helper called during 63 - * object registration that loops through the default attributes of the 64 - * subsystem and creates attributes files for them in sysfs. 65 - */ 66 - static int populate_dir(struct kobject *kobj) 67 - { 68 - const struct kobj_type *t = get_ktype(kobj); 69 - struct attribute *attr; 70 - int error = 0; 71 - int i; 72 - 73 - if (t && t->default_attrs) { 74 - for (i = 0; (attr = t->default_attrs[i]) != NULL; i++) { 75 - error = sysfs_create_file(kobj, attr); 76 - if (error) 77 - break; 78 - } 79 - } 80 - return error; 81 - } 82 - 83 57 static int create_dir(struct kobject *kobj) 84 58 { 85 59 const struct kobj_type *ktype = get_ktype(kobj); ··· 63 89 error = sysfs_create_dir_ns(kobj, kobject_namespace(kobj)); 64 90 if (error) 65 91 return error; 66 - 67 - error = populate_dir(kobj); 68 - if (error) { 69 - sysfs_remove_dir(kobj); 70 - return error; 71 - } 72 92 73 93 if (ktype) { 74 94 error = sysfs_create_groups(kobj, ktype->default_groups);