diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-12-07 15:48:07 -0500 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-12-13 18:46:55 -0500 |
commit | 63a9332b232bdab0df6ef18a9f39e8d58a82bda4 (patch) | |
tree | 52906e5888de9e634824d6005d9dbd3eb109bd2d /drivers/usb | |
parent | 45173d5ed4c9a397db31623bf6469efbd3a239cd (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/usb')
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 10 |
1 files changed, 6 insertions, 4 deletions
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 = { | |||
172 | 172 | ||
173 | static void __init | 173 | static void __init |
174 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | 174 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, |
175 | struct mbus_dram_target_info *dram) | 175 | const struct mbus_dram_target_info *dram) |
176 | { | 176 | { |
177 | int i; | 177 | int i; |
178 | 178 | ||
@@ -182,7 +182,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | |||
182 | } | 182 | } |
183 | 183 | ||
184 | for (i = 0; i < dram->num_cs; i++) { | 184 | for (i = 0; i < dram->num_cs; i++) { |
185 | struct mbus_dram_window *cs = dram->cs + i; | 185 | const struct mbus_dram_window *cs = dram->cs + i; |
186 | 186 | ||
187 | wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) | | 187 | wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) | |
188 | (cs->mbus_attr << 8) | | 188 | (cs->mbus_attr << 8) | |
@@ -194,6 +194,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | |||
194 | static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) | 194 | static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) |
195 | { | 195 | { |
196 | struct orion_ehci_data *pd = pdev->dev.platform_data; | 196 | struct orion_ehci_data *pd = pdev->dev.platform_data; |
197 | const struct mbus_dram_target_info *dram; | ||
197 | struct resource *res; | 198 | struct resource *res; |
198 | struct usb_hcd *hcd; | 199 | struct usb_hcd *hcd; |
199 | struct ehci_hcd *ehci; | 200 | struct ehci_hcd *ehci; |
@@ -259,8 +260,9 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) | |||
259 | /* | 260 | /* |
260 | * (Re-)program MBUS remapping windows if we are asked to. | 261 | * (Re-)program MBUS remapping windows if we are asked to. |
261 | */ | 262 | */ |
262 | if (pd != NULL && pd->dram != NULL) | 263 | dram = mv_mbus_dram_info(); |
263 | ehci_orion_conf_mbus_windows(hcd, pd->dram); | 264 | if (dram) |
265 | ehci_orion_conf_mbus_windows(hcd, dram); | ||
264 | 266 | ||
265 | /* | 267 | /* |
266 | * setup Orion USB controller. | 268 | * setup Orion USB controller. |