From b0744bd2925a4a24865963322534107d2ad553f9 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Sat, 25 Jun 2005 14:55:27 -0700 Subject: [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 Cc: Greg KH Cc: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/cio/css.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'drivers/s390/cio/css.c') diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 87bd70e..555119c 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -128,34 +128,28 @@ css_probe_device(int irq) return ret; } +static int +check_subchannel(struct device * dev, void * data) +{ + struct subchannel *sch; + int irq = (unsigned long)data; + + sch = to_subchannel(dev); + return (sch->irq == irq); +} + struct subchannel * get_subchannel_by_schid(int irq) { - struct subchannel *sch; - struct list_head *entry; struct device *dev; - if (!get_bus(&css_bus_type)) - return NULL; - down_read(&css_bus_type.subsys.rwsem); - sch = NULL; - list_for_each(entry, &css_bus_type.devices.list) { - dev = get_device(container_of(entry, - struct device, bus_list)); - if (!dev) - continue; - sch = to_subchannel(dev); - if (sch->irq == irq) - break; - put_device(dev); - sch = NULL; - } - up_read(&css_bus_type.subsys.rwsem); - put_bus(&css_bus_type); + dev = bus_find_device(&css_bus_type, NULL, + (void *)(unsigned long)irq, check_subchannel); - return sch; + return dev ? to_subchannel(dev) : NULL; } + static inline int css_get_subchannel_status(struct subchannel *sch, int schid) { -- cgit v1.1