MLK-22293-3 ata: ahci: Fix nport index issue
authorYe Li <ye.li@nxp.com>
Fri, 19 Jul 2019 03:40:23 +0000 (20:40 -0700)
committerYe Li <ye.li@nxp.com>
Fri, 26 Jul 2019 02:47:16 +0000 (19:47 -0700)
Ahci driver set max ports to 2, but the codes has comparing issue if we
only has one port. Also suppress the print of invalid port.

Signed-off-by: Ye Li <ye.li@nxp.com>
drivers/ata/ahci.c

index 5fafb63..f8f1815 100644 (file)
@@ -643,8 +643,8 @@ static int ahci_device_data_io(struct ahci_uc_priv *uc_priv, u8 port, u8 *fis,
 
        debug("Enter %s: for port %d\n", __func__, port);
 
-       if (port > uc_priv->n_ports) {
-               printf("Invalid port number %d\n", port);
+       if (port >= uc_priv->n_ports) {
+               debug("Invalid port number %d\n", port);
                return -1;
        }