]> git.ipfire.org Git - people/ms/u-boot.git/commit
dm: ahci: Unwind the confusing init code
authorSimon Glass <sjg@chromium.org>
Thu, 15 Jun 2017 03:28:37 +0000 (21:28 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 11 Jul 2017 16:08:19 +0000 (10:08 -0600)
commit7cf1afce7fa3fe64189020fe14b93f7326dd0758
tree5ebfa4fe9113898c4bb7ae87df1f21ede879fbdf
parent62b4ec8e302c7d616e37f2c2c2836edfea712309
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>
drivers/ata/ahci.c
drivers/ata/dwc_ahci.c
drivers/ata/sata_ceva.c
drivers/scsi/scsi-uclass.c
include/ahci.h
include/scsi.h