diff options
author | Dan Willemsen <dwillemsen@nvidia.com> | 2011-01-04 18:10:33 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:10 -0800 |
commit | ee9f7e4f43feddb9b2b7615fa2a06b901a2909a0 (patch) | |
tree | 109fe9b1b992762b315fe5b9589e57b8bb30f47d /arch/arm/mach-tegra/board-ventana.c | |
parent | 0fb8dbb5c3b9ef25c7c7480597cf4147ef5ca16f (diff) |
tegra: otg: Don't use global functions in board files
Releasing the platform_data in unregister.
Original-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>
Rebase-Id: Rae05dda59eed4eb707b0cbeb2460634cb307b479
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana.c')
-rw-r--r-- | arch/arm/mach-tegra/board-ventana.c | 26 |
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 345487b038a1..54e2047e24a5 100644 --- a/arch/arm/mach-tegra/board-ventana.c +++ b/arch/arm/mach-tegra/board-ventana.c @@ -261,7 +261,6 @@ static struct platform_device tegra_camera = { }; static struct platform_device *ventana_devices[] __initdata = { - &tegra_otg_device, &debug_uart, &tegra_uartb_device, &tegra_uartc_device, @@ -320,13 +319,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; @@ -366,11 +359,17 @@ 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 int __init ventana_gps_init(void) { struct clk *clk32 = clk_get_sys(NULL, "blink"); @@ -399,6 +398,15 @@ static void __init ventana_power_off_init(void) pm_power_off = ventana_power_off; } +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 void __init tegra_ventana_init(void) { tegra_common_init(); |