s390/cio: derive cdev information only for IO-subchannels
[linux-2.6-microblaze.git] / drivers / s390 / cio / css.c
index 4446192..2bc55cc 100644 (file)
@@ -792,10 +792,13 @@ static int __unset_online(struct device *dev, void *data)
 {
        struct idset *set = data;
        struct subchannel *sch = to_subchannel(dev);
-       struct ccw_device *cdev = sch_get_cdev(sch);
+       struct ccw_device *cdev;
 
-       if (cdev && cdev->online)
-               idset_sch_del(set, sch->schid);
+       if (sch->st == SUBCHANNEL_TYPE_IO) {
+               cdev = sch_get_cdev(sch);
+               if (cdev && cdev->online)
+                       idset_sch_del(set, sch->schid);
+       }
 
        return 0;
 }