summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/board-enterprise.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c
index 8c194b5bdd51..e0c88bad21d4 100644
--- a/arch/arm/mach-tegra/board-enterprise.c
+++ b/arch/arm/mach-tegra/board-enterprise.c
@@ -685,7 +685,6 @@ static struct tegra_otg_platform_data tegra_otg_pdata = {
struct platform_device *tegra_usb_hsic_host_register(void)
{
struct platform_device *pdev;
- void *platform_data;
int val;
pdev = platform_device_alloc(tegra_ehci2_device.name,
@@ -701,23 +700,17 @@ struct platform_device *tegra_usb_hsic_host_register(void)
pdev->dev.dma_mask = tegra_ehci2_device.dev.dma_mask;
pdev->dev.coherent_dma_mask = tegra_ehci2_device.dev.coherent_dma_mask;
- platform_data = kmalloc(sizeof(struct tegra_ehci_platform_data),
- GFP_KERNEL);
- if (!platform_data)
+ val = platform_device_add_data(pdev, &tegra_ehci_uhsic_pdata,
+ sizeof(struct tegra_ehci_platform_data));
+ if (val)
goto error;
- memcpy(platform_data, &tegra_ehci_uhsic_pdata,
- sizeof(struct tegra_ehci_platform_data));
- pdev->dev.platform_data = platform_data;
-
val = platform_device_add(pdev);
if (val)
- goto error_add;
+ goto error;
return pdev;
-error_add:
- kfree(platform_data);
error:
pr_err("%s: failed to add the host contoller device\n", __func__);
platform_device_put(pdev);