diff options
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 688945662c15..7646a9930ecb 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -552,21 +552,19 @@ ccw_device_register(struct ccw_device *cdev) | |||
552 | } | 552 | } |
553 | 553 | ||
554 | struct match_data { | 554 | struct match_data { |
555 | unsigned int devno; | 555 | struct ccw_dev_id dev_id; |
556 | unsigned int ssid; | ||
557 | struct ccw_device * sibling; | 556 | struct ccw_device * sibling; |
558 | }; | 557 | }; |
559 | 558 | ||
560 | static int | 559 | static int |
561 | match_devno(struct device * dev, void * data) | 560 | match_devno(struct device * dev, void * data) |
562 | { | 561 | { |
563 | struct match_data * d = (struct match_data *)data; | 562 | struct match_data * d = data; |
564 | struct ccw_device * cdev; | 563 | struct ccw_device * cdev; |
565 | 564 | ||
566 | cdev = to_ccwdev(dev); | 565 | cdev = to_ccwdev(dev); |
567 | if ((cdev->private->state == DEV_STATE_DISCONNECTED) && | 566 | if ((cdev->private->state == DEV_STATE_DISCONNECTED) && |
568 | (cdev->private->devno == d->devno) && | 567 | ccw_dev_id_is_equal(&cdev->private->dev_id, &d->dev_id) && |
569 | (cdev->private->ssid == d->ssid) && | ||
570 | (cdev != d->sibling)) { | 568 | (cdev != d->sibling)) { |
571 | cdev->private->state = DEV_STATE_NOT_OPER; | 569 | cdev->private->state = DEV_STATE_NOT_OPER; |
572 | return 1; | 570 | return 1; |
@@ -574,15 +572,13 @@ match_devno(struct device * dev, void * data) | |||
574 | return 0; | 572 | return 0; |
575 | } | 573 | } |
576 | 574 | ||
577 | static struct ccw_device * | 575 | static struct ccw_device * get_disc_ccwdev_by_dev_id(struct ccw_dev_id *dev_id, |
578 | get_disc_ccwdev_by_devno(unsigned int devno, unsigned int ssid, | 576 | struct ccw_device *sibling) |
579 | struct ccw_device *sibling) | ||
580 | { | 577 | { |
581 | struct device *dev; | 578 | struct device *dev; |
582 | struct match_data data; | 579 | struct match_data data; |
583 | 580 | ||
584 | data.devno = devno; | 581 | data.dev_id = *dev_id; |
585 | data.ssid = ssid; | ||
586 | data.sibling = sibling; | 582 | data.sibling = sibling; |
587 | dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); | 583 | dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); |
588 | 584 | ||
@@ -618,7 +614,7 @@ ccw_device_do_unreg_rereg(void *data) | |||
618 | 614 | ||
619 | cdev = (struct ccw_device *)data; | 615 | cdev = (struct ccw_device *)data; |
620 | sch = to_subchannel(cdev->dev.parent); | 616 | sch = to_subchannel(cdev->dev.parent); |
621 | if (cdev->private->devno != sch->schib.pmcw.dev) { | 617 | if (cdev->private->dev_id.devno != sch->schib.pmcw.dev) { |
622 | /* | 618 | /* |
623 | * The device number has changed. This is usually only when | 619 | * The device number has changed. This is usually only when |
624 | * a device has been detached under VM and then re-appeared | 620 | * a device has been detached under VM and then re-appeared |
@@ -633,10 +629,12 @@ ccw_device_do_unreg_rereg(void *data) | |||
633 | * get possibly sick... | 629 | * get possibly sick... |
634 | */ | 630 | */ |
635 | struct ccw_device *other_cdev; | 631 | struct ccw_device *other_cdev; |
632 | struct ccw_dev_id dev_id; | ||
636 | 633 | ||
637 | need_rename = 1; | 634 | need_rename = 1; |
638 | other_cdev = get_disc_ccwdev_by_devno(sch->schib.pmcw.dev, | 635 | dev_id.devno = sch->schib.pmcw.dev; |
639 | sch->schid.ssid, cdev); | 636 | dev_id.ssid = sch->schid.ssid; |
637 | other_cdev = get_disc_ccwdev_by_dev_id(&dev_id, cdev); | ||
640 | if (other_cdev) { | 638 | if (other_cdev) { |
641 | struct subchannel *other_sch; | 639 | struct subchannel *other_sch; |
642 | 640 | ||
@@ -652,7 +650,7 @@ ccw_device_do_unreg_rereg(void *data) | |||
652 | } | 650 | } |
653 | /* Update ssd info here. */ | 651 | /* Update ssd info here. */ |
654 | css_get_ssd_info(sch); | 652 | css_get_ssd_info(sch); |
655 | cdev->private->devno = sch->schib.pmcw.dev; | 653 | cdev->private->dev_id.devno = sch->schib.pmcw.dev; |
656 | } else | 654 | } else |
657 | need_rename = 0; | 655 | need_rename = 0; |
658 | device_remove_files(&cdev->dev); | 656 | device_remove_files(&cdev->dev); |
@@ -792,9 +790,9 @@ io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch) | |||
792 | 790 | ||
793 | /* Init private data. */ | 791 | /* Init private data. */ |
794 | priv = cdev->private; | 792 | priv = cdev->private; |
795 | priv->devno = sch->schib.pmcw.dev; | 793 | priv->dev_id.devno = sch->schib.pmcw.dev; |
796 | priv->ssid = sch->schid.ssid; | 794 | priv->dev_id.ssid = sch->schid.ssid; |
797 | priv->sch_no = sch->schid.sch_no; | 795 | priv->schid = sch->schid; |
798 | priv->state = DEV_STATE_NOT_OPER; | 796 | priv->state = DEV_STATE_NOT_OPER; |
799 | INIT_LIST_HEAD(&priv->cmb_list); | 797 | INIT_LIST_HEAD(&priv->cmb_list); |
800 | init_waitqueue_head(&priv->wait_q); | 798 | init_waitqueue_head(&priv->wait_q); |