diff options
author | Simon Glass <sjg@chromium.org> | 2017-06-15 06:28:37 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-07-11 19:08:19 +0300 |
commit | 7cf1afce7fa3fe64189020fe14b93f7326dd0758 (patch) | |
tree | 5ebfa4fe9113898c4bb7ae87df1f21ede879fbdf /drivers/ata/dwc_ahci.c | |
parent | 62b4ec8e302c7d616e37f2c2c2836edfea712309 (diff) | |
download | u-boot-7cf1afce7fa3fe64189020fe14b93f7326dd0758.tar.xz |
dm: ahci: Unwind the confusing init code
Two AHCI drivers use SCSI with CONFIG_DM_SCSI. The SCSI uclass calls
scsi_low_level_init() which is implemented by ahci.c. If
CONFIG_SCSI_AHCI_PLAT is defined it does one thing and if it is not
it does something else.
We don't need to call through scsi_low_level_init() to get the init
completed. Instead, adjust the two drivers to call into AHCI directly.
Drop the post-probe init in the SCSI uclass. This means that driver model
doesn't need to use scsi_low_level_init(). It is a legacy function and
driver model should use a driver's probe() method instead.
While we are here, add a comment to the top of the file explaining what
ahci.c does.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/ata/dwc_ahci.c')
-rw-r--r-- | drivers/ata/dwc_ahci.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ata/dwc_ahci.c b/drivers/ata/dwc_ahci.c index e634df5e3c..eadd77944c 100644 --- a/drivers/ata/dwc_ahci.c +++ b/drivers/ata/dwc_ahci.c @@ -81,7 +81,11 @@ static int dwc_ahci_probe(struct udevice *dev) writel(val, priv->wrapper_base + TI_SATA_SYSCONFIG); } - return ahci_init(priv->base); + ret = ahci_init(priv->base); + if (ret) + return ret; + + return achi_start_ports_dm(dev); } static const struct udevice_id dwc_ahci_ids[] = { |