]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] Use dev->groups for adding/removing the subchannel attribute group.
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 8 Dec 2006 14:55:57 +0000 (15:55 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 8 Dec 2006 14:55:57 +0000 (15:55 +0100)
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/css.c
drivers/s390/cio/css.h
drivers/s390/cio/device.c

index 0bf7166193782241ae67d48cf991e747947583e9..4c81d890791e48d1c04b001d842af56a49301c00 100644 (file)
@@ -137,6 +137,7 @@ css_register_subchannel(struct subchannel *sch)
        sch->dev.parent = &css[0]->device;
        sch->dev.bus = &css_bus_type;
        sch->dev.release = &css_subchannel_release;
+       sch->dev.groups = subch_attr_groups;
 
        /* make it known to the system */
        ret = css_sch_device_register(sch);
@@ -146,10 +147,6 @@ css_register_subchannel(struct subchannel *sch)
                return ret;
        }
        css_get_ssd_info(sch);
-       ret = subchannel_add_files(&sch->dev);
-       if (ret)
-               printk(KERN_WARNING "%s: could not add attributes to %s\n",
-                      __func__, sch->dev.bus_id);
        return ret;
 }
 
index 71fe380f86f6ecb6233374d7553c7419435481f9..3464c5b875c470d8436f8054c740ff6a17f661f0 100644 (file)
@@ -195,4 +195,5 @@ extern struct workqueue_struct *slow_path_wq;
 extern struct work_struct slow_path_work;
 
 int subchannel_add_files (struct device *);
+extern struct attribute_group *subch_attr_groups[];
 #endif
index 7fe1ccdc7812b5ffcf60f7580e30b9fb44626d65..803579053c2fe012dbf4854b13c12baa156a8f86 100644 (file)
@@ -235,9 +235,11 @@ chpids_show (struct device * dev, struct device_attribute *attr, char * buf)
        ssize_t ret = 0;
        int chp;
 
-       for (chp = 0; chp < 8; chp++)
-               ret += sprintf (buf+ret, "%02x ", ssd->chpid[chp]);
-
+       if (ssd)
+               for (chp = 0; chp < 8; chp++)
+                       ret += sprintf (buf+ret, "%02x ", ssd->chpid[chp]);
+       else
+               ret += sprintf (buf, "n/a");
        ret += sprintf (buf+ret, "\n");
        return min((ssize_t)PAGE_SIZE, ret);
 }
@@ -531,10 +533,10 @@ static struct attribute_group subch_attr_group = {
        .attrs = subch_attrs,
 };
 
-int subchannel_add_files (struct device *dev)
-{
-       return sysfs_create_group(&dev->kobj, &subch_attr_group);
-}
+struct attribute_group *subch_attr_groups[] = {
+       &subch_attr_group,
+       NULL,
+};
 
 static struct attribute * ccwdev_attrs[] = {
        &dev_attr_devtype.attr,