[S390] cio: introduce fcx enabled scsw format
[linux-block.git] / drivers / s390 / cio / cmf.c
index f4c132ab39edef112c72faad0c492dd3971d0ed7..6c77c2326bd4461fcd75a8d75bbc0f71bfa039de 100644 (file)
@@ -341,12 +341,12 @@ static int cmf_copy_block(struct ccw_device *cdev)
        if (stsch(sch->schid, &sch->schib))
                return -ENODEV;
 
-       if (sch->schib.scsw.fctl & SCSW_FCTL_START_FUNC) {
+       if (scsw_fctl(&sch->schib.scsw) & SCSW_FCTL_START_FUNC) {
                /* Don't copy if a start function is in progress. */
-               if ((!(sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED)) &&
-                   (sch->schib.scsw.actl &
+               if ((!(scsw_actl(&sch->schib.scsw) & SCSW_ACTL_SUSPENDED)) &&
+                   (scsw_actl(&sch->schib.scsw) &
                     (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) &&
-                   (!(sch->schib.scsw.stctl & SCSW_STCTL_SEC_STATUS)))
+                   (!(scsw_stctl(&sch->schib.scsw) & SCSW_STCTL_SEC_STATUS)))
                        return -EBUSY;
        }
        cmb_data = cdev->private->cmb;
@@ -1219,16 +1219,21 @@ static ssize_t cmb_enable_store(struct device *dev,
 {
        struct ccw_device *cdev;
        int ret;
+       unsigned long val;
+
+       ret = strict_strtoul(buf, 16, &val);
+       if (ret)
+               return ret;
 
        cdev = to_ccwdev(dev);
 
-       switch (buf[0]) {
-       case '0':
+       switch (val) {
+       case 0:
                ret = disable_cmf(cdev);
                if (ret)
                        dev_info(&cdev->dev, "disable_cmf failed (%d)\n", ret);
                break;
-       case '1':
+       case 1:
                ret = enable_cmf(cdev);
                if (ret && ret != -EBUSY)
                        dev_info(&cdev->dev, "enable_cmf failed (%d)\n", ret);