summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-06-14 21:28:31 -0600
committerSimon Glass <sjg@chromium.org>2017-07-11 10:08:19 -0600
commit1dc64f6c00e89f11e3615403459207405ab0efda (patch)
treee3095ec40a37e7e48a38cbabfa6391e7458823ae /drivers/scsi
parentb9560ad649b8c523bf303cf9ba981e498988c5d9 (diff)
dm: scsi: Use the uclass platform data
At present the two driver-model SCSI drivers use device platform data to store information that relates to the uclass. It is better to use uclass platform data in this situation. Update the code to do this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi-uclass.c1
-rw-r--r--drivers/scsi/scsi.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/scsi-uclass.c b/drivers/scsi/scsi-uclass.c
index 05da6cdeab8..e4ee44bb4c3 100644
--- a/drivers/scsi/scsi-uclass.c
+++ b/drivers/scsi/scsi-uclass.c
@@ -24,4 +24,5 @@ UCLASS_DRIVER(scsi) = {
.id = UCLASS_SCSI,
.name = "scsi",
.post_probe = scsi_post_probe,
+ .per_device_platdata_auto_alloc_size = sizeof(struct scsi_platdata),
};
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 5f5652b9e03..2d0f81ad1f1 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -619,7 +619,7 @@ int scsi_scan(int mode)
return ret;
/* Get controller platdata */
- plat = dev_get_platdata(dev);
+ plat = dev_get_uclass_platdata(dev);
for (i = 0; i < plat->max_id; i++)
for (lun = 0; lun < plat->max_lun; lun++)