diff options
author | Cornelia Huck <cohuck@de.ibm.com> | 2005-06-25 17:55:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:36 -0400 |
commit | b0744bd2925a4a24865963322534107d2ad553f9 (patch) | |
tree | 7e09f76872685d29dd03a0955ee948c4f00f4f8b /drivers/s390/cio/css.c | |
parent | 84dd8d7e9c080b4db66b00b8bc36ccf09a90f824 (diff) |
[PATCH] s/390: Use klist in cio
Convert the common I/O layer to use the klist interfaces.
This patch has been adapted from the previous version to the changed interface
semantics. Also, gcc 4.0 compile warnings have been removed.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r-- | drivers/s390/cio/css.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 87bd70eeabed..555119cacc27 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -128,34 +128,28 @@ css_probe_device(int irq) | |||
128 | return ret; | 128 | return ret; |
129 | } | 129 | } |
130 | 130 | ||
131 | static int | ||
132 | check_subchannel(struct device * dev, void * data) | ||
133 | { | ||
134 | struct subchannel *sch; | ||
135 | int irq = (unsigned long)data; | ||
136 | |||
137 | sch = to_subchannel(dev); | ||
138 | return (sch->irq == irq); | ||
139 | } | ||
140 | |||
131 | struct subchannel * | 141 | struct subchannel * |
132 | get_subchannel_by_schid(int irq) | 142 | get_subchannel_by_schid(int irq) |
133 | { | 143 | { |
134 | struct subchannel *sch; | ||
135 | struct list_head *entry; | ||
136 | struct device *dev; | 144 | struct device *dev; |
137 | 145 | ||
138 | if (!get_bus(&css_bus_type)) | 146 | dev = bus_find_device(&css_bus_type, NULL, |
139 | return NULL; | 147 | (void *)(unsigned long)irq, check_subchannel); |
140 | down_read(&css_bus_type.subsys.rwsem); | ||
141 | sch = NULL; | ||
142 | list_for_each(entry, &css_bus_type.devices.list) { | ||
143 | dev = get_device(container_of(entry, | ||
144 | struct device, bus_list)); | ||
145 | if (!dev) | ||
146 | continue; | ||
147 | sch = to_subchannel(dev); | ||
148 | if (sch->irq == irq) | ||
149 | break; | ||
150 | put_device(dev); | ||
151 | sch = NULL; | ||
152 | } | ||
153 | up_read(&css_bus_type.subsys.rwsem); | ||
154 | put_bus(&css_bus_type); | ||
155 | 148 | ||
156 | return sch; | 149 | return dev ? to_subchannel(dev) : NULL; |
157 | } | 150 | } |
158 | 151 | ||
152 | |||
159 | static inline int | 153 | static inline int |
160 | css_get_subchannel_status(struct subchannel *sch, int schid) | 154 | css_get_subchannel_status(struct subchannel *sch, int schid) |
161 | { | 155 | { |