diff options
Diffstat (limited to 'drivers/scsi/ses.c')
-rw-r--r-- | drivers/scsi/ses.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index a6d96694d0a5..45df83b9d847 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c | |||
@@ -107,7 +107,7 @@ static int ses_set_page2_descriptor(struct enclosure_device *edev, | |||
107 | unsigned char *desc) | 107 | unsigned char *desc) |
108 | { | 108 | { |
109 | int i, j, count = 0, descriptor = ecomp->number; | 109 | int i, j, count = 0, descriptor = ecomp->number; |
110 | struct scsi_device *sdev = to_scsi_device(edev->cdev.dev); | 110 | struct scsi_device *sdev = to_scsi_device(edev->edev.parent); |
111 | struct ses_device *ses_dev = edev->scratch; | 111 | struct ses_device *ses_dev = edev->scratch; |
112 | unsigned char *type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11]; | 112 | unsigned char *type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11]; |
113 | unsigned char *desc_ptr = ses_dev->page2 + 8; | 113 | unsigned char *desc_ptr = ses_dev->page2 + 8; |
@@ -137,7 +137,7 @@ static unsigned char *ses_get_page2_descriptor(struct enclosure_device *edev, | |||
137 | struct enclosure_component *ecomp) | 137 | struct enclosure_component *ecomp) |
138 | { | 138 | { |
139 | int i, j, count = 0, descriptor = ecomp->number; | 139 | int i, j, count = 0, descriptor = ecomp->number; |
140 | struct scsi_device *sdev = to_scsi_device(edev->cdev.dev); | 140 | struct scsi_device *sdev = to_scsi_device(edev->edev.parent); |
141 | struct ses_device *ses_dev = edev->scratch; | 141 | struct ses_device *ses_dev = edev->scratch; |
142 | unsigned char *type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11]; | 142 | unsigned char *type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11]; |
143 | unsigned char *desc_ptr = ses_dev->page2 + 8; | 143 | unsigned char *desc_ptr = ses_dev->page2 + 8; |
@@ -269,10 +269,10 @@ int ses_match_host(struct enclosure_device *edev, void *data) | |||
269 | struct ses_host_edev *sed = data; | 269 | struct ses_host_edev *sed = data; |
270 | struct scsi_device *sdev; | 270 | struct scsi_device *sdev; |
271 | 271 | ||
272 | if (!scsi_is_sdev_device(edev->cdev.dev)) | 272 | if (!scsi_is_sdev_device(edev->edev.parent)) |
273 | return 0; | 273 | return 0; |
274 | 274 | ||
275 | sdev = to_scsi_device(edev->cdev.dev); | 275 | sdev = to_scsi_device(edev->edev.parent); |
276 | 276 | ||
277 | if (sdev->host != sed->shost) | 277 | if (sdev->host != sed->shost) |
278 | return 0; | 278 | return 0; |
@@ -407,10 +407,10 @@ static void ses_match_to_enclosure(struct enclosure_device *edev, | |||
407 | 407 | ||
408 | #define INIT_ALLOC_SIZE 32 | 408 | #define INIT_ALLOC_SIZE 32 |
409 | 409 | ||
410 | static int ses_intf_add(struct class_device *cdev, | 410 | static int ses_intf_add(struct device *cdev, |
411 | struct class_interface *intf) | 411 | struct class_interface *intf) |
412 | { | 412 | { |
413 | struct scsi_device *sdev = to_scsi_device(cdev->dev); | 413 | struct scsi_device *sdev = to_scsi_device(cdev->parent); |
414 | struct scsi_device *tmp_sdev; | 414 | struct scsi_device *tmp_sdev; |
415 | unsigned char *buf = NULL, *hdr_buf, *type_ptr, *desc_ptr = NULL, | 415 | unsigned char *buf = NULL, *hdr_buf, *type_ptr, *desc_ptr = NULL, |
416 | *addl_desc_ptr = NULL; | 416 | *addl_desc_ptr = NULL; |
@@ -426,7 +426,7 @@ static int ses_intf_add(struct class_device *cdev, | |||
426 | edev = enclosure_find(&sdev->host->shost_gendev); | 426 | edev = enclosure_find(&sdev->host->shost_gendev); |
427 | if (edev) { | 427 | if (edev) { |
428 | ses_match_to_enclosure(edev, sdev); | 428 | ses_match_to_enclosure(edev, sdev); |
429 | class_device_put(&edev->cdev); | 429 | put_device(&edev->edev); |
430 | } | 430 | } |
431 | return -ENODEV; | 431 | return -ENODEV; |
432 | } | 432 | } |
@@ -515,7 +515,7 @@ static int ses_intf_add(struct class_device *cdev, | |||
515 | if (!scomp) | 515 | if (!scomp) |
516 | goto err_free; | 516 | goto err_free; |
517 | 517 | ||
518 | edev = enclosure_register(cdev->dev, sdev->sdev_gendev.bus_id, | 518 | edev = enclosure_register(cdev->parent, sdev->sdev_gendev.bus_id, |
519 | components, &ses_enclosure_callbacks); | 519 | components, &ses_enclosure_callbacks); |
520 | if (IS_ERR(edev)) { | 520 | if (IS_ERR(edev)) { |
521 | err = PTR_ERR(edev); | 521 | err = PTR_ERR(edev); |
@@ -625,17 +625,17 @@ static int ses_remove(struct device *dev) | |||
625 | return 0; | 625 | return 0; |
626 | } | 626 | } |
627 | 627 | ||
628 | static void ses_intf_remove(struct class_device *cdev, | 628 | static void ses_intf_remove(struct device *cdev, |
629 | struct class_interface *intf) | 629 | struct class_interface *intf) |
630 | { | 630 | { |
631 | struct scsi_device *sdev = to_scsi_device(cdev->dev); | 631 | struct scsi_device *sdev = to_scsi_device(cdev->parent); |
632 | struct enclosure_device *edev; | 632 | struct enclosure_device *edev; |
633 | struct ses_device *ses_dev; | 633 | struct ses_device *ses_dev; |
634 | 634 | ||
635 | if (!scsi_device_enclosure(sdev)) | 635 | if (!scsi_device_enclosure(sdev)) |
636 | return; | 636 | return; |
637 | 637 | ||
638 | edev = enclosure_find(cdev->dev); | 638 | edev = enclosure_find(cdev->parent); |
639 | if (!edev) | 639 | if (!edev) |
640 | return; | 640 | return; |
641 | 641 | ||
@@ -649,13 +649,13 @@ static void ses_intf_remove(struct class_device *cdev, | |||
649 | 649 | ||
650 | kfree(edev->component[0].scratch); | 650 | kfree(edev->component[0].scratch); |
651 | 651 | ||
652 | class_device_put(&edev->cdev); | 652 | put_device(&edev->edev); |
653 | enclosure_unregister(edev); | 653 | enclosure_unregister(edev); |
654 | } | 654 | } |
655 | 655 | ||
656 | static struct class_interface ses_interface = { | 656 | static struct class_interface ses_interface = { |
657 | .add = ses_intf_add, | 657 | .add_dev = ses_intf_add, |
658 | .remove = ses_intf_remove, | 658 | .remove_dev = ses_intf_remove, |
659 | }; | 659 | }; |
660 | 660 | ||
661 | static struct scsi_driver ses_template = { | 661 | static struct scsi_driver ses_template = { |