diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2006-12-08 09:55:57 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-12-08 09:55:57 -0500 |
commit | 529192f3b90682e37c5fcab461d968d062f1e0e4 (patch) | |
tree | 33f5c9f5b50c36c2f62d0afee1636bd5f5fa07c6 /drivers/s390/cio | |
parent | d7b5a4c94f49131811112526f7d404a50f0b5ca7 (diff) |
[S390] Use dev->groups for adding/removing the subchannel attribute group.
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>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/css.c | 5 | ||||
-rw-r--r-- | drivers/s390/cio/css.h | 1 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 16 |
3 files changed, 11 insertions, 11 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 0bf716619378..4c81d890791e 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -137,6 +137,7 @@ css_register_subchannel(struct subchannel *sch) | |||
137 | sch->dev.parent = &css[0]->device; | 137 | sch->dev.parent = &css[0]->device; |
138 | sch->dev.bus = &css_bus_type; | 138 | sch->dev.bus = &css_bus_type; |
139 | sch->dev.release = &css_subchannel_release; | 139 | sch->dev.release = &css_subchannel_release; |
140 | sch->dev.groups = subch_attr_groups; | ||
140 | 141 | ||
141 | /* make it known to the system */ | 142 | /* make it known to the system */ |
142 | ret = css_sch_device_register(sch); | 143 | ret = css_sch_device_register(sch); |
@@ -146,10 +147,6 @@ css_register_subchannel(struct subchannel *sch) | |||
146 | return ret; | 147 | return ret; |
147 | } | 148 | } |
148 | css_get_ssd_info(sch); | 149 | css_get_ssd_info(sch); |
149 | ret = subchannel_add_files(&sch->dev); | ||
150 | if (ret) | ||
151 | printk(KERN_WARNING "%s: could not add attributes to %s\n", | ||
152 | __func__, sch->dev.bus_id); | ||
153 | return ret; | 150 | return ret; |
154 | } | 151 | } |
155 | 152 | ||
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index 71fe380f86f6..3464c5b875c4 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h | |||
@@ -195,4 +195,5 @@ extern struct workqueue_struct *slow_path_wq; | |||
195 | extern struct work_struct slow_path_work; | 195 | extern struct work_struct slow_path_work; |
196 | 196 | ||
197 | int subchannel_add_files (struct device *); | 197 | int subchannel_add_files (struct device *); |
198 | extern struct attribute_group *subch_attr_groups[]; | ||
198 | #endif | 199 | #endif |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 7fe1ccdc7812..803579053c2f 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -235,9 +235,11 @@ chpids_show (struct device * dev, struct device_attribute *attr, char * buf) | |||
235 | ssize_t ret = 0; | 235 | ssize_t ret = 0; |
236 | int chp; | 236 | int chp; |
237 | 237 | ||
238 | for (chp = 0; chp < 8; chp++) | 238 | if (ssd) |
239 | ret += sprintf (buf+ret, "%02x ", ssd->chpid[chp]); | 239 | for (chp = 0; chp < 8; chp++) |
240 | 240 | ret += sprintf (buf+ret, "%02x ", ssd->chpid[chp]); | |
241 | else | ||
242 | ret += sprintf (buf, "n/a"); | ||
241 | ret += sprintf (buf+ret, "\n"); | 243 | ret += sprintf (buf+ret, "\n"); |
242 | return min((ssize_t)PAGE_SIZE, ret); | 244 | return min((ssize_t)PAGE_SIZE, ret); |
243 | } | 245 | } |
@@ -531,10 +533,10 @@ static struct attribute_group subch_attr_group = { | |||
531 | .attrs = subch_attrs, | 533 | .attrs = subch_attrs, |
532 | }; | 534 | }; |
533 | 535 | ||
534 | int subchannel_add_files (struct device *dev) | 536 | struct attribute_group *subch_attr_groups[] = { |
535 | { | 537 | &subch_attr_group, |
536 | return sysfs_create_group(&dev->kobj, &subch_attr_group); | 538 | NULL, |
537 | } | 539 | }; |
538 | 540 | ||
539 | static struct attribute * ccwdev_attrs[] = { | 541 | static struct attribute * ccwdev_attrs[] = { |
540 | &dev_attr_devtype.attr, | 542 | &dev_attr_devtype.attr, |