aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-06-14 21:28:43 -0600
committerSimon Glass <sjg@chromium.org>2017-07-11 10:08:19 -0600
commitf6ab5a92acc78371fc088075b64bd394d1f0d45f (patch)
treea3f3ebb2d9eddd7f7009adbc4cc01abf5c63c787 /drivers/ata/ahci.c
parent4e7490145800ea8da5f67a4fbaa66caab7689ce3 (diff)
downloadu-boot-f6ab5a92acc78371fc088075b64bd394d1f0d45f.zip
u-boot-f6ab5a92acc78371fc088075b64bd394d1f0d45f.tar.gz
u-boot-f6ab5a92acc78371fc088075b64bd394d1f0d45f.tar.bz2
dm: scsi: Add operations for SCSI devices
The SCSI uclass currently has no operations. It just uses the global SCSI functions. Fix this by adding operations to the only two drivers that use the uclass, and replacing the global functions with those defined locally in the SCSI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 9c7b043..5a20b97 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1141,6 +1141,12 @@ static int ahci_scsi_bus_reset(struct udevice *dev)
return 0;
}
+#ifdef CONFIG_DM_SCSI
+struct scsi_ops scsi_ops = {
+ .exec = ahci_scsi_exec,
+ .bus_reset = ahci_scsi_bus_reset,
+};
+#else
int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
{
return ahci_scsi_exec(dev, pccb);
@@ -1152,3 +1158,4 @@ __weak int scsi_bus_reset(struct udevice *dev)
return 0;
}
+#endif