From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [Patch -mm 1/2] s390: Use dev->groups for subchannel attributes.
Date: Wed, 29 Nov 2006 13:49:26 +0100 [thread overview]
Message-ID: <20061129134926.4c8472a2@gondolin.boeblingen.de.ibm.com> (raw)
From: Cornelia Huck <cornelia.huck@de.ibm.com>
Use dev->groups for adding/removing the subchannel attribute group.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
drivers/s390/cio/css.c | 5 +----
drivers/s390/cio/css.h | 1 +
drivers/s390/cio/device.c | 16 +++++++++-------
3 files changed, 11 insertions(+), 11 deletions(-)
--- linux-2.6-CH.orig/drivers/s390/cio/css.c
+++ linux-2.6-CH/drivers/s390/cio/css.c
@@ -137,6 +137,7 @@ css_register_subchannel(struct subchanne
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 subchanne
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;
}
--- linux-2.6-CH.orig/drivers/s390/cio/css.h
+++ linux-2.6-CH/drivers/s390/cio/css.h
@@ -190,4 +190,5 @@ extern struct workqueue_struct *slow_pat
extern struct work_struct slow_path_work;
int subchannel_add_files (struct device *);
+extern struct attribute_group *subch_attr_groups[];
#endif
--- linux-2.6-CH.orig/drivers/s390/cio/device.c
+++ linux-2.6-CH/drivers/s390/cio/device.c
@@ -235,9 +235,11 @@ chpids_show (struct device * dev, struct
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);
}
@@ -529,10 +531,10 @@ static struct attribute_group subch_attr
.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,
reply other threads:[~2006-11-29 12:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061129134926.4c8472a2@gondolin.boeblingen.de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®