[PATCH] sata_sil: make it buildable with DM_PCI

Marcin Juszkiewicz marcin at juszkiewicz.com.pl
Thu Jun 4 13:29:22 CEST 2020


Linker complained about lack of `pci_virt_to_mem` function.
Looks like driver was not ready for device model - I took solution from
e1000.c driver.

Signed-off-by: Marcin Juszkiewicz <marcin at juszkiewicz.com.pl>
---
 drivers/ata/sata_sil.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git drivers/ata/sata_sil.c drivers/ata/sata_sil.c
index 6896fa8771..5f9d4378e2 100644
--- drivers/ata/sata_sil.c
+++ drivers/ata/sata_sil.c
@@ -27,7 +27,11 @@
 
 #include "sata_sil.h"
 
+#ifdef CONFIG_DM_PCI
+#define virt_to_bus(devno, v)	dm_pci_virt_to_mem(devno, (void *) (v))
+#else
 #define virt_to_bus(devno, v)	pci_virt_to_mem(devno, (void *) (v))
+#endif
 
 /* just compatible ahci_ops */
 struct sil_ops {
-- 
2.26.2



More information about the U-Boot mailing list