aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2011-12-07 15:48:07 -0500
committerNicolas Pitre <nico@fluxnic.net>2011-12-13 18:46:55 -0500
commit63a9332b232bdab0df6ef18a9f39e8d58a82bda4 (patch)
tree52906e5888de9e634824d6005d9dbd3eb109bd2d /drivers/ata
parent45173d5ed4c9a397db31623bf6469efbd3a239cd (diff)
ARM: Orion: Get address map from plat-orion instead of via platform_data
Use an getter function in plat-orion/addr-map.c to get the address map structure, rather than pass it to drivers in the platform_data structures. When the drivers are built for none orion platforms, a dummy function is provided instead which returns NULL. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Michael Walle <michael@walle.cc> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_mv.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 0b8b8b488ee8..38950ea8398a 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -3988,7 +3988,7 @@ static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
3988} 3988}
3989 3989
3990static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, 3990static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
3991 struct mbus_dram_target_info *dram) 3991 const struct mbus_dram_target_info *dram)
3992{ 3992{
3993 int i; 3993 int i;
3994 3994
@@ -3998,7 +3998,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
3998 } 3998 }
3999 3999
4000 for (i = 0; i < dram->num_cs; i++) { 4000 for (i = 0; i < dram->num_cs; i++) {
4001 struct mbus_dram_window *cs = dram->cs + i; 4001 const struct mbus_dram_window *cs = dram->cs + i;
4002 4002
4003 writel(((cs->size - 1) & 0xffff0000) | 4003 writel(((cs->size - 1) & 0xffff0000) |
4004 (cs->mbus_attr << 8) | 4004 (cs->mbus_attr << 8) |
@@ -4019,6 +4019,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
4019static int mv_platform_probe(struct platform_device *pdev) 4019static int mv_platform_probe(struct platform_device *pdev)
4020{ 4020{
4021 const struct mv_sata_platform_data *mv_platform_data; 4021 const struct mv_sata_platform_data *mv_platform_data;
4022 const struct mbus_dram_target_info *dram;
4022 const struct ata_port_info *ppi[] = 4023 const struct ata_port_info *ppi[] =
4023 { &mv_port_info[chip_soc], NULL }; 4024 { &mv_port_info[chip_soc], NULL };
4024 struct ata_host *host; 4025 struct ata_host *host;
@@ -4072,8 +4073,9 @@ static int mv_platform_probe(struct platform_device *pdev)
4072 /* 4073 /*
4073 * (Re-)program MBUS remapping windows if we are asked to. 4074 * (Re-)program MBUS remapping windows if we are asked to.
4074 */ 4075 */
4075 if (mv_platform_data->dram != NULL) 4076 dram = mv_mbus_dram_info();
4076 mv_conf_mbus_windows(hpriv, mv_platform_data->dram); 4077 if (dram)
4078 mv_conf_mbus_windows(hpriv, dram);
4077 4079
4078 rc = mv_create_dma_pools(hpriv, &pdev->dev); 4080 rc = mv_create_dma_pools(hpriv, &pdev->dev);
4079 if (rc) 4081 if (rc)
@@ -4141,17 +4143,18 @@ static int mv_platform_suspend(struct platform_device *pdev, pm_message_t state)
4141static int mv_platform_resume(struct platform_device *pdev) 4143static int mv_platform_resume(struct platform_device *pdev)
4142{ 4144{
4143 struct ata_host *host = platform_get_drvdata(pdev); 4145 struct ata_host *host = platform_get_drvdata(pdev);
4146 const struct mbus_dram_target_info *dram;
4144 int ret; 4147 int ret;
4145 4148
4146 if (host) { 4149 if (host) {
4147 struct mv_host_priv *hpriv = host->private_data; 4150 struct mv_host_priv *hpriv = host->private_data;
4148 const struct mv_sata_platform_data *mv_platform_data = \ 4151
4149 pdev->dev.platform_data;
4150 /* 4152 /*
4151 * (Re-)program MBUS remapping windows if we are asked to. 4153 * (Re-)program MBUS remapping windows if we are asked to.
4152 */ 4154 */
4153 if (mv_platform_data->dram != NULL) 4155 dram = mv_mbus_dram_info();
4154 mv_conf_mbus_windows(hpriv, mv_platform_data->dram); 4156 if (dram)
4157 mv_conf_mbus_windows(hpriv, dram);
4155 4158
4156 /* initialize adapter */ 4159 /* initialize adapter */
4157 ret = mv_init_host(host); 4160 ret = mv_init_host(host);