summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-ventana.c
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@nvidia.com>2011-01-04 18:10:33 -0800
committerBharat Nihalani <bnihalani@nvidia.com>2011-01-05 02:44:37 -0800
commit7a087a2b09895ab81ecace6b0e98f222006e447a (patch)
tree3ebb1150d7ff3503e6647e91c29902591e0eb7bd /arch/arm/mach-tegra/board-ventana.c
parentf68763913b21267e2c3536b69a842a627721d5a8 (diff)
tegra: otg: Don't use global functions in board files
Releasing the platform_data in unregister. Change-Id: Iba1c6e7ad42b0886f8ce9dadf9664bcc266398d4 Reviewed-on: http://git-master/r/14963 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana.c')
-rw-r--r--arch/arm/mach-tegra/board-ventana.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index 854ce5bdb2a1..6b9b04d121c4 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -369,7 +369,6 @@ static struct platform_device tegra_camera = {
};
static struct platform_device *ventana_devices[] __initdata = {
- &tegra_otg_device,
&tegra_usb_fsg_device,
&androidusb_device,
&debug_uart,
@@ -487,13 +486,7 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
},
};
-static void ventana_usb_init(void)
-{
- tegra_ehci3_device.dev.platform_data=&tegra_ehci_pdata[2];
- platform_device_register(&tegra_ehci3_device);
-}
-
-struct platform_device *tegra_usb_otg_host_register(void)
+static struct platform_device *tegra_usb_otg_host_register(void)
{
struct platform_device *pdev;
void *platform_data;
@@ -533,11 +526,26 @@ error:
return NULL;
}
-void tegra_usb_otg_host_unregister(struct platform_device *pdev)
+static void tegra_usb_otg_host_unregister(struct platform_device *pdev)
{
+ kfree(pdev->dev.platform_data);
platform_device_unregister(pdev);
}
+static struct tegra_otg_platform_data tegra_otg_pdata = {
+ .host_register = &tegra_usb_otg_host_register,
+ .host_unregister = &tegra_usb_otg_host_unregister,
+};
+
+static void ventana_usb_init(void)
+{
+ tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
+ platform_device_register(&tegra_otg_device);
+
+ tegra_ehci3_device.dev.platform_data=&tegra_ehci_pdata[2];
+ platform_device_register(&tegra_ehci3_device);
+}
+
static int __init ventana_gps_init(void)
{
struct clk *clk32 = clk_get_sys(NULL, "blink");