Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / drivers / s390 / cio / chsc.c
index c28444a..72187e5 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/config.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/device.h>
@@ -238,10 +239,13 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
        /* Check for single path devices. */
        if (sch->schib.pmcw.pim == 0x80)
                goto out_unreg;
+       if (sch->vpm == mask)
+               goto out_unreg;
 
        if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
            (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
-           (sch->schib.pmcw.lpum == mask)) {
+           (sch->schib.pmcw.lpum == mask) &&
+           (sch->vpm == 0)) {
                int cc;
 
                cc = cio_clear(sch);
@@ -256,8 +260,6 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
        /* trigger path verification. */
        if (sch->driver && sch->driver->verify)
                sch->driver->verify(&sch->dev);
-       else if (sch->vpm == mask)
-               goto out_unreg;
 out_unlock:
        spin_unlock_irq(&sch->lock);
        return 0;
@@ -916,13 +918,12 @@ chp_measurement_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
        chp = to_channelpath(container_of(kobj, struct device, kobj));
        css = to_css(chp->dev.parent);
 
-       size = sizeof(struct cmg_entry);
+       size = sizeof(struct cmg_chars);
 
        /* Only allow single reads. */
        if (off || count < size)
                return 0;
        chp_measurement_copy_block((struct cmg_entry *)buf, css, chp->id);
-       count = size;
        return count;
 }
 
@@ -1391,8 +1392,10 @@ new_channel_path(int chpid)
        /* fill in status, etc. */
        chp->id = chpid;
        chp->state = 1;
-       chp->dev.parent = &css[0]->device;
-       chp->dev.release = chp_release;
+       chp->dev = (struct device) {
+               .parent  = &css[0]->device,
+               .release = chp_release,
+       };
        snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp0.%x", chpid);
 
        /* Obtain channel path description and fill it in. */
@@ -1462,40 +1465,6 @@ chsc_get_chp_desc(struct subchannel *sch, int chp_no)
        return desc;
 }
 
-static int reset_channel_path(struct channel_path *chp)
-{
-       int cc;
-
-       cc = rchp(chp->id);
-       switch (cc) {
-       case 0:
-               return 0;
-       case 2:
-               return -EBUSY;
-       default:
-               return -ENODEV;
-       }
-}
-
-static void reset_channel_paths_css(struct channel_subsystem *css)
-{
-       int i;
-
-       for (i = 0; i <= __MAX_CHPID; i++) {
-               if (css->chps[i])
-                       reset_channel_path(css->chps[i]);
-       }
-}
-
-void cio_reset_channel_paths(void)
-{
-       int i;
-
-       for (i = 0; i <= __MAX_CSSID; i++) {
-               if (css[i] && css[i]->valid)
-                       reset_channel_paths_css(css[i]);
-       }
-}
 
 static int __init
 chsc_alloc_sei_area(void)