diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2005-06-26 17:19:40 -0400 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2005-06-26 17:19:40 -0400 |
| commit | 2a322e4c08be4e7cb0c04b427ddaaa679fd88863 (patch) | |
| tree | ad8cc17bfd3b5e57e36f07a249028667d72f0b96 /drivers/s390/cio/css.c | |
| parent | ba6d2377c85c9b8a793f455d8c9b6cf31985d70f (diff) | |
| parent | 8678887e7fb43cd6c9be6c9807b05e77848e0920 (diff) | |
Automatic merge with /usr/src/ntfs-2.6.git.
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 | { |
