diff options
author | Simon Glass <sjg@chromium.org> | 2017-06-14 21:28:40 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-07-11 10:08:19 -0600 |
commit | 4682c8a19b4eb69f7ad51df3f543375583ce878a (patch) | |
tree | 09ea9daa3d0f8737086c5659fb4f1428e20d235a /drivers/ata | |
parent | 322f73f473d921dbdd0fe11bd62db6a00e5b133c (diff) |
dm: scsi: Add a device pointer to scan_exec(), scsi_bus_reset()
With driver model these functions need a device pointer. Add one even
when CONFIG_DM_SCSI is not defined. This avoids having ugly conditional
function prototypes, When CONFIG_DM_SCSI is not defined we can just ignore
the pointer.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2f77e6030d..c3b5f2af34 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -26,7 +26,9 @@ static int ata_io_flush(struct ahci_uc_priv *uc_priv, u8 port); +#ifndef CONFIG_DM_SCSI struct ahci_uc_priv *probe_ent = NULL; +#endif #define writel_with_flush(a,b) do { writel(a,b); readl(b); } while (0) @@ -926,9 +928,14 @@ static int ata_scsiop_test_unit_ready(struct ahci_uc_priv *uc_priv, } -int scsi_exec(struct scsi_cmd *pccb) +int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb) { - struct ahci_uc_priv *uc_priv = probe_ent; + struct ahci_uc_priv *uc_priv; +#ifdef CONFIG_DM_SCSI + uc_priv = dev_get_uclass_priv(dev); +#else + uc_priv = probe_ent; +#endif int ret; switch (pccb->cmd[0]) { @@ -1128,7 +1135,9 @@ static int ata_io_flush(struct ahci_uc_priv *uc_priv, u8 port) } -__weak void scsi_bus_reset(void) +__weak int scsi_bus_reset(struct udevice *dev) { /*Not implement*/ + + return 0; } |