When only using bin_attrs instead of attrs the kernel prints a warning and refuses to create the sysfs entry. This fixes that.
Unified · Split
| @@ -93,8 +93,8 @@ static int internal_create_group(struct kobject *kobj, int update, · 92 unmodified lines | |||
| 93 | /* Updates may happen before the object has been instantiated */ | 93 | /* Updates may happen before the object has been instantiated */ |
| 94 | if (unlikely(update && !kobj->sd)) | 94 | if (unlikely(update && !kobj->sd)) |
| 95 | return -EINVAL; | 95 | return -EINVAL; |
| 96 | if (!grp->attrs) { | 96 | if (!grp->attrs && !grp->bin_attrs) { |
| 97 | WARN(1, "sysfs: attrs not set by subsystem for group: %s/%s\n", | 97 | WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n", |
| 98 | kobj->name, grp->name ? "" : grp->name); | 98 | kobj->name, grp->name ? "" : grp->name); |
| 99 | return -EINVAL; | 99 | return -EINVAL; |
| 100 | } | 100 | } |