diff options
Diffstat (limited to 'arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c')
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c index 4c54e1109f9d..3c53f598ce67 100644 --- a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c +++ b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2011-2014 Freescale Semiconductor, Inc. All Rights Reserved. * * Copyright (C) 2010 Pengutronix * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> @@ -69,7 +69,7 @@ struct platform_device *__init imx_add_fsl_usb2_udc( pdev = platform_device_alloc(name, id); if (!pdev) - goto err; + return ERR_PTR(ret); if (dmamask) { /* @@ -82,7 +82,7 @@ struct platform_device *__init imx_add_fsl_usb2_udc( kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); if (!pdev->dev.dma_mask) /* ret is still -ENOMEM; */ - goto err; + goto err1; *pdev->dev.dma_mask = dmamask; pdev->dev.coherent_dma_mask = dmamask; @@ -92,17 +92,16 @@ struct platform_device *__init imx_add_fsl_usb2_udc( if (ret) goto err; - if (data) { - ret = platform_device_add_data(pdev, pdata, size_data); - if (ret) - goto err; - } + ret = platform_device_add_data(pdev, pdata, size_data); + if (ret) + goto err; return pdev; err: if (dmamask) kfree(pdev->dev.dma_mask); +err1: platform_device_put(pdev); return ERR_PTR(ret); } |