This patch is the beginning of moving the attribute_containers to use
attribute groups exclusively. The attr element is now deprecated and
will eventually be removed (along with all the hand rolled code for
doing exactly what attribute groups do) when all the consumers are
converted to attribute groups.
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
struct class_device_attribute **attrs = cont->attrs;
int i, error;
struct class_device_attribute **attrs = cont->attrs;
int i, error;
+ BUG_ON(attrs && cont->grp);
+
+ if (!attrs && !cont->grp)
+ if (cont->grp)
+ return sysfs_create_group(&classdev->kobj, cont->grp);
+
for (i = 0; attrs[i]; i++) {
error = class_device_create_file(classdev, attrs[i]);
if (error)
for (i = 0; attrs[i]; i++) {
error = class_device_create_file(classdev, attrs[i]);
if (error)
struct class_device_attribute **attrs = cont->attrs;
int i;
struct class_device_attribute **attrs = cont->attrs;
int i;
+ if (!attrs && !cont->grp)
+ if (cont->grp) {
+ sysfs_remove_group(&classdev->kobj, cont->grp);
+ return ;
+ }
+
for (i = 0; attrs[i]; i++)
class_device_remove_file(classdev, attrs[i]);
}
for (i = 0; attrs[i]; i++)
class_device_remove_file(classdev, attrs[i]);
}
struct list_head node;
struct klist containers;
struct class *class;
struct list_head node;
struct klist containers;
struct class *class;
+ struct attribute_group *grp;
struct class_device_attribute **attrs;
int (*match)(struct attribute_container *, struct device *);
#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
struct class_device_attribute **attrs;
int (*match)(struct attribute_container *, struct device *);
#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01