]> err.no Git - linux-2.6/blobdiff - drivers/s390/cio/css.c
Merge branch 'core/softlockup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6] / drivers / s390 / cio / css.c
index 45ba07c0a28629c2bd7c27dd659591db0b659693..46c021d880dc5ee7441cd11f8e885bf54d79b7dd 100644 (file)
@@ -164,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);
@@ -850,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;
 }