summaryrefslogtreecommitdiff
path: root/drivers/scsi
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/scsi
parent4e7490145800ea8da5f67a4fbaa66caab7689ce3 (diff)
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/scsi')
-rw-r--r--drivers/scsi/scsi-uclass.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/scsi/scsi-uclass.c b/drivers/scsi/scsi-uclass.c
index 40c5044f09..31e8999297 100644
--- a/drivers/scsi/scsi-uclass.c
+++ b/drivers/scsi/scsi-uclass.c
@@ -13,6 +13,26 @@
#include <dm.h>
#include <scsi.h>
+int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
+{
+ struct scsi_ops *ops = scsi_get_ops(dev);
+
+ if (!ops->exec)
+ return -ENOSYS;
+
+ return ops->exec(dev, pccb);
+}
+
+int scsi_bus_reset(struct udevice *dev)
+{
+ struct scsi_ops *ops = scsi_get_ops(dev);
+
+ if (!ops->bus_reset)
+ return -ENOSYS;
+
+ return ops->bus_reset(dev);
+}
+
UCLASS_DRIVER(scsi) = {
.id = UCLASS_SCSI,
.name = "scsi",