diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-12-07 21:48:07 +0100 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-12-14 00:46:55 +0100 |
commit | 63a9332b232bdab0df6ef18a9f39e8d58a82bda4 (patch) | |
tree | 52906e5888de9e634824d6005d9dbd3eb109bd2d /drivers | |
parent | ARM: Orion: mbus_dram_info consolidation (diff) | |
download | linux-63a9332b232bdab0df6ef18a9f39e8d58a82bda4.tar.xz linux-63a9332b232bdab0df6ef18a9f39e8d58a82bda4.zip |
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')
-rw-r--r-- | drivers/ata/sata_mv.c | 19 | ||||
-rw-r--r-- | drivers/dma/mv_xor.c | 11 | ||||
-rw-r--r-- | drivers/mmc/host/mvsdio.c | 13 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/mv643xx_eth.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 10 |
5 files changed, 37 insertions, 26 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) } static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, - struct mbus_dram_target_info *dram) + const struct mbus_dram_target_info *dram) { int i; @@ -3998,7 +3998,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, } for (i = 0; i < dram->num_cs; i++) { - struct mbus_dram_window *cs = dram->cs + i; + const struct mbus_dram_window *cs = dram->cs + i; writel(((cs->size - 1) & 0xffff0000) | (cs->mbus_attr << 8) | @@ -4019,6 +4019,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, static int mv_platform_probe(struct platform_device *pdev) { const struct mv_sata_platform_data *mv_platform_data; + const struct mbus_dram_target_info *dram; const struct ata_port_info *ppi[] = { &mv_port_info[chip_soc], NULL }; struct ata_host *host; @@ -4072,8 +4073,9 @@ static int mv_platform_probe(struct platform_device *pdev) /* * (Re-)program MBUS remapping windows if we are asked to. */ - if (mv_platform_data->dram != NULL) - mv_conf_mbus_windows(hpriv, mv_platform_data->dram); + dram = mv_mbus_dram_info(); + if (dram) + mv_conf_mbus_windows(hpriv, dram); rc = mv_create_dma_pools(hpriv, &pdev->dev); if (rc) @@ -4141,17 +4143,18 @@ static int mv_platform_suspend(struct platform_device *pdev, pm_message_t state) static int mv_platform_resume(struct platform_device *pdev) { struct ata_host *host = platform_get_drvdata(pdev); + const struct mbus_dram_target_info *dram; int ret; if (host) { struct mv_host_priv *hpriv = host->private_data; - const struct mv_sata_platform_data *mv_platform_data = \ - pdev->dev.platform_data; + /* * (Re-)program MBUS remapping windows if we are asked to. */ - if (mv_platform_data->dram != NULL) - mv_conf_mbus_windows(hpriv, mv_platform_data->dram); + dram = mv_mbus_dram_info(); + if (dram) + mv_conf_mbus_windows(hpriv, dram); /* initialize adapter */ ret = mv_init_host(host); diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 9a353c2216d0..e779b434af45 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c @@ -1250,7 +1250,7 @@ static int __devinit mv_xor_probe(struct platform_device *pdev) static void mv_xor_conf_mbus_windows(struct mv_xor_shared_private *msp, - struct mbus_dram_target_info *dram) + const struct mbus_dram_target_info *dram) { void __iomem *base = msp->xor_base; u32 win_enable = 0; @@ -1264,7 +1264,7 @@ mv_xor_conf_mbus_windows(struct mv_xor_shared_private *msp, } for (i = 0; i < dram->num_cs; i++) { - struct mbus_dram_window *cs = dram->cs + i; + const struct mbus_dram_window *cs = dram->cs + i; writel((cs->base & 0xffff0000) | (cs->mbus_attr << 8) | @@ -1290,7 +1290,7 @@ static struct platform_driver mv_xor_driver = { static int mv_xor_shared_probe(struct platform_device *pdev) { - struct mv_xor_platform_shared_data *msd = pdev->dev.platform_data; + const struct mbus_dram_target_info *dram; struct mv_xor_shared_private *msp; struct resource *res; @@ -1323,8 +1323,9 @@ static int mv_xor_shared_probe(struct platform_device *pdev) /* * (Re-)program MBUS remapping windows if we are asked to. */ - if (msd != NULL && msd->dram != NULL) - mv_xor_conf_mbus_windows(msp, msd->dram); + dram = mv_mbus_dram_info(); + if (dram) + mv_xor_conf_mbus_windows(msp, dram); return 0; } diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 211a4959c293..eeb8cd125b0c 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -679,8 +679,9 @@ static const struct mmc_host_ops mvsd_ops = { .enable_sdio_irq = mvsd_enable_sdio_irq, }; -static void __init mv_conf_mbus_windows(struct mvsd_host *host, - struct mbus_dram_target_info *dram) +static void __init +mv_conf_mbus_windows(struct mvsd_host *host, + const struct mbus_dram_target_info *dram) { void __iomem *iobase = host->base; int i; @@ -691,7 +692,7 @@ static void __init mv_conf_mbus_windows(struct mvsd_host *host, } for (i = 0; i < dram->num_cs; i++) { - struct mbus_dram_window *cs = dram->cs + i; + const struct mbus_dram_window *cs = dram->cs + i; writel(((cs->size - 1) & 0xffff0000) | (cs->mbus_attr << 8) | (dram->mbus_dram_target_id << 4) | 1, @@ -705,6 +706,7 @@ static int __init mvsd_probe(struct platform_device *pdev) struct mmc_host *mmc = NULL; struct mvsd_host *host = NULL; const struct mvsdio_platform_data *mvsd_data; + const struct mbus_dram_target_info *dram; struct resource *r; int ret, irq; @@ -755,8 +757,9 @@ static int __init mvsd_probe(struct platform_device *pdev) } /* (Re-)program MBUS remapping windows if we are asked to. */ - if (mvsd_data->dram != NULL) - mv_conf_mbus_windows(host, mvsd_data->dram); + dram = mv_mbus_dram_info(); + if (dram) + mv_conf_mbus_windows(host, dram); mvsd_power_down(host); diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 194a03113802..e93be7954a19 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2509,7 +2509,7 @@ static void mv643xx_eth_netpoll(struct net_device *dev) /* platform glue ************************************************************/ static void mv643xx_eth_conf_mbus_windows(struct mv643xx_eth_shared_private *msp, - struct mbus_dram_target_info *dram) + const struct mbus_dram_target_info *dram) { void __iomem *base = msp->base; u32 win_enable; @@ -2527,7 +2527,7 @@ mv643xx_eth_conf_mbus_windows(struct mv643xx_eth_shared_private *msp, win_protect = 0; for (i = 0; i < dram->num_cs; i++) { - struct mbus_dram_window *cs = dram->cs + i; + const struct mbus_dram_window *cs = dram->cs + i; writel((cs->base & 0xffff0000) | (cs->mbus_attr << 8) | @@ -2577,6 +2577,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) static int mv643xx_eth_version_printed; struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; struct mv643xx_eth_shared_private *msp; + const struct mbus_dram_target_info *dram; struct resource *res; int ret; @@ -2641,8 +2642,9 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) /* * (Re-)program MBUS remapping windows if we are asked to. */ - if (pd != NULL && pd->dram != NULL) - mv643xx_eth_conf_mbus_windows(msp, pd->dram); + dram = mv_mbus_dram_info(); + if (dram) + mv643xx_eth_conf_mbus_windows(msp, dram); /* * Detect hardware parameters. diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index a68a2a5c4b83..6c6a5a3b4ea7 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c @@ -172,7 +172,7 @@ static const struct hc_driver ehci_orion_hc_driver = { static void __init ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, - struct mbus_dram_target_info *dram) + const struct mbus_dram_target_info *dram) { int i; @@ -182,7 +182,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, } for (i = 0; i < dram->num_cs; i++) { - struct mbus_dram_window *cs = dram->cs + i; + const struct mbus_dram_window *cs = dram->cs + i; wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) | (cs->mbus_attr << 8) | @@ -194,6 +194,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) { struct orion_ehci_data *pd = pdev->dev.platform_data; + const struct mbus_dram_target_info *dram; struct resource *res; struct usb_hcd *hcd; struct ehci_hcd *ehci; @@ -259,8 +260,9 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) /* * (Re-)program MBUS remapping windows if we are asked to. */ - if (pd != NULL && pd->dram != NULL) - ehci_orion_conf_mbus_windows(hcd, pd->dram); + dram = mv_mbus_dram_info(); + if (dram) + ehci_orion_conf_mbus_windows(hcd, dram); /* * setup Orion USB controller. |