aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/blacklist.c
diff options
context:
space:
mode:
authorCornelia Huck <cohuck@de.ibm.com>2006-01-06 03:19:22 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:51 -0500
commitf97a56fb768e5fe9cd07c56ca47870136bb5530c (patch)
tree05108317a0cca7aa04cd68f4fcb7b7d3a295ddfa /drivers/s390/cio/blacklist.c
parenta8237fc4108060402d904bea5e1062e22e731969 (diff)
[PATCH] s390: introduce for_each_subchannel
for_each_subchannel() is an iterator calling a function for every possible subchannel id until non-zero is returned. Convert the current iterating functions to it. Signed-off-by: Cornelia Huck <cohuck@de.ibm.com> Signed-off-by: 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/blacklist.c')
-rw-r--r--drivers/s390/cio/blacklist.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index a4b03031ff50..25e98483d4e4 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -219,6 +219,27 @@ is_blacklisted (int devno)
219} 219}
220 220
221#ifdef CONFIG_PROC_FS 221#ifdef CONFIG_PROC_FS
222static int
223__s390_redo_validation(struct subchannel_id schid, void *data)
224{
225 int ret;
226 struct subchannel *sch;
227
228 sch = get_subchannel_by_schid(schid);
229 if (sch) {
230 /* Already known. */
231 put_device(&sch->dev);
232 return 0;
233 }
234 ret = css_probe_device(schid);
235 if (ret == -ENXIO)
236 return ret; /* We're through. */
237 if (ret == -ENOMEM)
238 /* Stop validation for now. Bad, but no need for a panic. */
239 return ret;
240 return 0;
241}
242
222/* 243/*
223 * Function: s390_redo_validation 244 * Function: s390_redo_validation
224 * Look for no longer blacklisted devices 245 * Look for no longer blacklisted devices
@@ -226,30 +247,9 @@ is_blacklisted (int devno)
226static inline void 247static inline void
227s390_redo_validation (void) 248s390_redo_validation (void)
228{ 249{
229 struct subchannel_id schid;
230
231 CIO_TRACE_EVENT (0, "redoval"); 250 CIO_TRACE_EVENT (0, "redoval");
232 init_subchannel_id(&schid); 251
233 do { 252 for_each_subchannel(__s390_redo_validation, NULL);
234 int ret;
235 struct subchannel *sch;
236
237 sch = get_subchannel_by_schid(schid);
238 if (sch) {
239 /* Already known. */
240 put_device(&sch->dev);
241 continue;
242 }
243 ret = css_probe_device(schid);
244 if (ret == -ENXIO)
245 break; /* We're through. */
246 if (ret == -ENOMEM)
247 /*
248 * Stop validation for now. Bad, but no need for a
249 * panic.
250 */
251 break;
252 } while (schid.sch_no++ < __MAX_SUBCHANNEL);
253} 253}
254 254
255/* 255/*