Instead of assuming 2 devices, get the max from the host controller.

Signed-off-by: Tim Harvey <thar...@gateworks.com>
---
 drivers/ata/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 81d16925dd..e7d590f69a 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1181,12 +1181,12 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong 
base)
        uc_plat = dev_get_uclass_platdata(dev);
        uc_plat->base = base;
        uc_plat->max_lun = 1;
-       uc_plat->max_id = 2;
 
        uc_priv = dev_get_uclass_priv(ahci_dev);
        ret = ahci_init_one(uc_priv, dev);
        if (ret)
                return ret;
+       uc_plat->max_id = uc_priv->n_ports;
        ret = ahci_start_ports(uc_priv);
        if (ret)
                return ret;
-- 
2.17.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to