diff options
| author | Jeff Garzik <jgarzik@pretzel.yyz.us> | 2005-06-26 23:42:30 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-26 23:42:30 -0400 |
| commit | f45727d52d1581e9ff4df9d1a12a60789ad2d1eb (patch) | |
| tree | 773ae25f98542e6d382c688f7e85e8137d065614 /drivers/s390/cio/css.c | |
| parent | 4c925f452cfd16c690209e96821ee094e09a2404 (diff) | |
| parent | 5696c1944a33b4434a9a1ebb6383b906afd43a10 (diff) | |
Merge /spare/repo/netdev-2.6/ branch 'ieee80211'
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 | { |
