diff options
author | Cornelia Huck <cohuck@de.ibm.com> | 2006-01-06 00:19:22 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 08:33:51 -0800 |
commit | f97a56fb768e5fe9cd07c56ca47870136bb5530c (patch) | |
tree | 05108317a0cca7aa04cd68f4fcb7b7d3a295ddfa /drivers/s390/cio/blacklist.c | |
parent | a8237fc4108060402d904bea5e1062e22e731969 (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.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index a4b03031ff5..25e98483d4e 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c @@ -219,6 +219,27 @@ is_blacklisted (int devno) } #ifdef CONFIG_PROC_FS +static int +__s390_redo_validation(struct subchannel_id schid, void *data) +{ + int ret; + struct subchannel *sch; + + sch = get_subchannel_by_schid(schid); + if (sch) { + /* Already known. */ + put_device(&sch->dev); + return 0; + } + ret = css_probe_device(schid); + if (ret == -ENXIO) + return ret; /* We're through. */ + if (ret == -ENOMEM) + /* Stop validation for now. Bad, but no need for a panic. */ + return ret; + return 0; +} + /* * Function: s390_redo_validation * Look for no longer blacklisted devices @@ -226,30 +247,9 @@ is_blacklisted (int devno) static inline void s390_redo_validation (void) { - struct subchannel_id schid; - CIO_TRACE_EVENT (0, "redoval"); - init_subchannel_id(&schid); - do { - int ret; - struct subchannel *sch; - - sch = get_subchannel_by_schid(schid); - if (sch) { - /* Already known. */ - put_device(&sch->dev); - continue; - } - ret = css_probe_device(schid); - if (ret == -ENXIO) - break; /* We're through. */ - if (ret == -ENOMEM) - /* - * Stop validation for now. Bad, but no need for a - * panic. - */ - break; - } while (schid.sch_no++ < __MAX_SUBCHANNEL); + + for_each_subchannel(__s390_redo_validation, NULL); } /* |