diff mbox

[3/5] ata: ahci_ceva: use the new port_{offset,length} members

Message ID 1461335561-18363-4-git-send-email-thomas.petazzoni@free-electrons.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Thomas Petazzoni April 22, 2016, 2:32 p.m. UTC
Now that the ahci_host_priv structure contains port_offset and
port_length members, this commit moves the ahci_ceva driver to use
them rather than hardcoded values.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/ata/ahci_ceva.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index 207649d..38611f2 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -79,8 +79,6 @@ 
 #define PORT_SCTL_SPD_GEN1	(0x1 << 4)
 #define PORT_SCTL_IPM		(0x3 << 8)
 
-#define PORT_BASE	0x100
-#define PORT_OFFSET	0x80
 #define NR_PORTS	2
 #define DRV_NAME	"ahci-ceva"
 #define CEVA_FLAG_BROKEN_GEN2	1
@@ -154,7 +152,8 @@  static void ahci_ceva_setup(struct ahci_host_priv *hpriv)
 		tmp = PORT_SCTL_SPD_GEN2 | PORT_SCTL_IPM;
 		if (cevapriv->flags & CEVA_FLAG_BROKEN_GEN2)
 			tmp = PORT_SCTL_SPD_GEN1 | PORT_SCTL_IPM;
-		writel(tmp, mmio + PORT_SCR_CTL + PORT_BASE + PORT_OFFSET * i);
+		writel(tmp, mmio + PORT_SCR_CTL + hpriv->port_offset +
+		       hpriv->port_length * i);
 	}
 }