Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/cio: move ccw_device_call_handler

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>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
8421d212 439eb131

+38 -48
-2
drivers/s390/cio/device.h
··· 128 128 void ccw_device_stlck_start(struct ccw_device *, void *, void *, void *); 129 129 void ccw_device_stlck_done(struct ccw_device *, void *, int); 130 130 131 - int ccw_device_call_handler(struct ccw_device *); 132 - 133 131 int ccw_device_stlck(struct ccw_device *); 134 132 135 133 /* Helper function for machine check handling. */
+38
drivers/s390/cio/device_fsm.c
··· 731 731 } 732 732 733 733 /* 734 + * Pass interrupt to device driver. 735 + */ 736 + static int ccw_device_call_handler(struct ccw_device *cdev) 737 + { 738 + unsigned int stctl; 739 + int ending_status; 740 + 741 + /* 742 + * we allow for the device action handler if . 743 + * - we received ending status 744 + * - the action handler requested to see all interrupts 745 + * - we received an intermediate status 746 + * - fast notification was requested (primary status) 747 + * - unsolicited interrupts 748 + */ 749 + stctl = scsw_stctl(&cdev->private->irb.scsw); 750 + ending_status = (stctl & SCSW_STCTL_SEC_STATUS) || 751 + (stctl == (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)) || 752 + (stctl == SCSW_STCTL_STATUS_PEND); 753 + if (!ending_status && 754 + !cdev->private->options.repall && 755 + !(stctl & SCSW_STCTL_INTER_STATUS) && 756 + !(cdev->private->options.fast && 757 + (stctl & SCSW_STCTL_PRIM_STATUS))) 758 + return 0; 759 + 760 + if (ending_status) 761 + ccw_device_set_timeout(cdev, 0); 762 + 763 + if (cdev->handler) 764 + cdev->handler(cdev, cdev->private->intparm, 765 + &cdev->private->irb); 766 + 767 + memset(&cdev->private->irb, 0, sizeof(struct irb)); 768 + return 1; 769 + } 770 + 771 + /* 734 772 * Got an interrupt for a normal io (state online). 735 773 */ 736 774 static void
-46
drivers/s390/cio/device_ops.c
··· 412 412 return cio_resume(sch); 413 413 } 414 414 415 - /* 416 - * Pass interrupt to device driver. 417 - */ 418 - int 419 - ccw_device_call_handler(struct ccw_device *cdev) 420 - { 421 - unsigned int stctl; 422 - int ending_status; 423 - 424 - /* 425 - * we allow for the device action handler if . 426 - * - we received ending status 427 - * - the action handler requested to see all interrupts 428 - * - we received an intermediate status 429 - * - fast notification was requested (primary status) 430 - * - unsolicited interrupts 431 - */ 432 - stctl = scsw_stctl(&cdev->private->irb.scsw); 433 - ending_status = (stctl & SCSW_STCTL_SEC_STATUS) || 434 - (stctl == (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)) || 435 - (stctl == SCSW_STCTL_STATUS_PEND); 436 - if (!ending_status && 437 - !cdev->private->options.repall && 438 - !(stctl & SCSW_STCTL_INTER_STATUS) && 439 - !(cdev->private->options.fast && 440 - (stctl & SCSW_STCTL_PRIM_STATUS))) 441 - return 0; 442 - 443 - /* Clear pending timers for device driver initiated I/O. */ 444 - if (ending_status) 445 - ccw_device_set_timeout(cdev, 0); 446 - /* 447 - * Now we are ready to call the device driver interrupt handler. 448 - */ 449 - if (cdev->handler) 450 - cdev->handler(cdev, cdev->private->intparm, 451 - &cdev->private->irb); 452 - 453 - /* 454 - * Clear the old and now useless interrupt response block. 455 - */ 456 - memset(&cdev->private->irb, 0, sizeof(struct irb)); 457 - 458 - return 1; 459 - } 460 - 461 415 /** 462 416 * ccw_device_get_ciw() - Search for CIW command in extended sense data. 463 417 * @cdev: ccw device to inspect