s390/cio: move ccw_device_call_handler
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Mon, 26 Oct 2015 11:35:06 +0000 (12:35 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 27 Oct 2015 08:34:43 +0000 (09:34 +0100)
device_ops.c should only contain functions that are called by ccw device
drivers. Move the cio internal function ccw_device_call_handler to
device_fsm.c where it's used. Remove some useless comments while at it.

Acked-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/device.h
drivers/s390/cio/device_fsm.c
drivers/s390/cio/device_ops.c

index 6b17119c99291be49d8c551d28308dce1c2e776e..23c1e19776d8509416d1e640656f7fe6df9ff0ab 100644 (file)
@@ -128,8 +128,6 @@ void ccw_device_disband_done(struct ccw_device *, int);
 void ccw_device_stlck_start(struct ccw_device *, void *, void *, void *);
 void ccw_device_stlck_done(struct ccw_device *, void *, int);
 
-int ccw_device_call_handler(struct ccw_device *);
-
 int ccw_device_stlck(struct ccw_device *);
 
 /* Helper function for machine check handling. */
index 83da53c8e54c5b982d604d1c7f91846404d9072b..92e03b42e661f009e5bd2ebb7f21833a2b4e8ea0 100644 (file)
@@ -730,6 +730,44 @@ static void ccw_device_boxed_verify(struct ccw_device *cdev,
                css_schedule_eval(sch->schid);
 }
 
+/*
+ * Pass interrupt to device driver.
+ */
+static int ccw_device_call_handler(struct ccw_device *cdev)
+{
+       unsigned int stctl;
+       int ending_status;
+
+       /*
+        * we allow for the device action handler if .
+        *  - we received ending status
+        *  - the action handler requested to see all interrupts
+        *  - we received an intermediate status
+        *  - fast notification was requested (primary status)
+        *  - unsolicited interrupts
+        */
+       stctl = scsw_stctl(&cdev->private->irb.scsw);
+       ending_status = (stctl & SCSW_STCTL_SEC_STATUS) ||
+               (stctl == (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)) ||
+               (stctl == SCSW_STCTL_STATUS_PEND);
+       if (!ending_status &&
+           !cdev->private->options.repall &&
+           !(stctl & SCSW_STCTL_INTER_STATUS) &&
+           !(cdev->private->options.fast &&
+             (stctl & SCSW_STCTL_PRIM_STATUS)))
+               return 0;
+
+       if (ending_status)
+               ccw_device_set_timeout(cdev, 0);
+
+       if (cdev->handler)
+               cdev->handler(cdev, cdev->private->intparm,
+                             &cdev->private->irb);
+
+       memset(&cdev->private->irb, 0, sizeof(struct irb));
+       return 1;
+}
+
 /*
  * Got an interrupt for a normal io (state online).
  */
index 6acd0b5776948a128ff986d0f06b7bbfa3581e30..5be77254547c1f4e09d95431fd7a0213dcec916c 100644 (file)
@@ -412,52 +412,6 @@ int ccw_device_resume(struct ccw_device *cdev)
        return cio_resume(sch);
 }
 
-/*
- * Pass interrupt to device driver.
- */
-int
-ccw_device_call_handler(struct ccw_device *cdev)
-{
-       unsigned int stctl;
-       int ending_status;
-
-       /*
-        * we allow for the device action handler if .
-        *  - we received ending status
-        *  - the action handler requested to see all interrupts
-        *  - we received an intermediate status
-        *  - fast notification was requested (primary status)
-        *  - unsolicited interrupts
-        */
-       stctl = scsw_stctl(&cdev->private->irb.scsw);
-       ending_status = (stctl & SCSW_STCTL_SEC_STATUS) ||
-               (stctl == (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)) ||
-               (stctl == SCSW_STCTL_STATUS_PEND);
-       if (!ending_status &&
-           !cdev->private->options.repall &&
-           !(stctl & SCSW_STCTL_INTER_STATUS) &&
-           !(cdev->private->options.fast &&
-             (stctl & SCSW_STCTL_PRIM_STATUS)))
-               return 0;
-
-       /* Clear pending timers for device driver initiated I/O. */
-       if (ending_status)
-               ccw_device_set_timeout(cdev, 0);
-       /*
-        * Now we are ready to call the device driver interrupt handler.
-        */
-       if (cdev->handler)
-               cdev->handler(cdev, cdev->private->intparm,
-                             &cdev->private->irb);
-
-       /*
-        * Clear the old and now useless interrupt response block.
-        */
-       memset(&cdev->private->irb, 0, sizeof(struct irb));
-
-       return 1;
-}
-
 /**
  * ccw_device_get_ciw() - Search for CIW command in extended sense data.
  * @cdev: ccw device to inspect