summaryrefslogtreecommitdiff
path: root/fs/sysfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-04-19 12:58:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-04-19 12:58:08 -0700
commit8c2bf4a2e5cb4b325e328cc8808858a68616067c (patch)
tree207417db8edd8120600b98fc0c83e612e9639653 /fs/sysfs
parentbea8d77e45a8b77f2beca1affc9aa7ed28f39b17 (diff)
parent5b484311507b5d403c1f7a45f6aa3778549e268b (diff)
downloadlinux-next-8c2bf4a2e5cb4b325e328cc8808858a68616067c.tar.gz
linux-next-8c2bf4a2e5cb4b325e328cc8808858a68616067c.zip
Merge tag 'driver-core-7.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core
Pull driver core fixes from Danilo Krummrich: - Prevent a device from being probed before device_add() has finished initializing it; gate probe with a "ready_to_probe" device flag to avoid races with concurrent driver_register() calls - Fix a kernel-doc warning for DEV_FLAG_COUNT introduced by the above - Return -ENOTCONN from software_node_get_reference_args() when a referenced software node is known but not yet registered, allowing callers to defer probe - In sysfs_group_attrs_change_owner(), also check is_visible_const(); missed when the const variant was introduced * tag 'driver-core-7.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: driver core: Add kernel-doc for DEV_FLAG_COUNT enum value sysfs: attribute_group: Respect is_visible_const() when changing owner software node: return -ENOTCONN when referenced swnode is not registered yet driver core: Don't let a device probe until it's ready
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/group.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index b3edae0578c0..182e54e575ee 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -517,8 +517,11 @@ static int sysfs_group_attrs_change_owner(struct kobject *kobj,
struct attribute *const *attr;
for (i = 0, attr = grp->attrs; *attr; i++, attr++) {
- if (grp->is_visible) {
- mode = grp->is_visible(kobj, *attr, i);
+ if (grp->is_visible || grp->is_visible_const) {
+ if (grp->is_visible)
+ mode = grp->is_visible(kobj, *attr, i);
+ else
+ mode = grp->is_visible_const(kobj, *attr, i);
if (mode & SYSFS_GROUP_INVISIBLE)
break;
if (!mode)