]> err.no Git - linux-2.6/blobdiff - drivers/s390/cio/css.c
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-pull
[linux-2.6] / drivers / s390 / cio / css.c
index ebed2212778d5cc3334b6be383ecbd1a87359c2a..46c021d880dc5ee7441cd11f8e885bf54d79b7dd 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/errno.h>
 #include <linux/list.h>
 #include <linux/reboot.h>
+#include <asm/isc.h>
 
 #include "../s390mach.h"
 #include "css.h"
@@ -163,7 +164,8 @@ static int css_sch_device_register(struct subchannel *sch)
 void css_sch_device_unregister(struct subchannel *sch)
 {
        mutex_lock(&sch->reg_mutex);
-       device_unregister(&sch->dev);
+       if (device_is_registered(&sch->dev))
+               device_unregister(&sch->dev);
        mutex_unlock(&sch->reg_mutex);
 }
 EXPORT_SYMBOL_GPL(css_sch_device_unregister);
@@ -804,7 +806,8 @@ init_channel_subsystem (void)
                goto out_pseudo;
        css_init_done = 1;
 
-       ctl_set_bit(6, 28);
+       /* Enable default isc for I/O subchannels. */
+       isc_register(IO_SCH_ISC);
 
        for_each_subchannel(__init_channel_subsystem, NULL);
        return 0;
@@ -848,19 +851,16 @@ int sch_is_pseudo_sch(struct subchannel *sch)
        return sch == to_css(sch->dev.parent)->pseudo_subchannel;
 }
 
-/*
- * find a driver for a subchannel. They identify by the subchannel
- * type with the exception that the console subchannel driver has its own
- * subchannel type although the device is an i/o subchannel
- */
-static int
-css_bus_match (struct device *dev, struct device_driver *drv)
+static int css_bus_match(struct device *dev, struct device_driver *drv)
 {
        struct subchannel *sch = to_subchannel(dev);
        struct css_driver *driver = to_cssdriver(drv);
+       struct css_device_id *id;
 
-       if (sch->st == driver->subchannel_type)
-               return 1;
+       for (id = driver->subchannel_type; id->match_flags; id++) {
+               if (sch->st == id->type)
+                       return 1;
+       }
 
        return 0;
 }