diff options
author | Peter Chen <peter.chen@freescale.com> | 2015-02-11 12:44:44 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-18 16:19:08 +0100 |
commit | a4cf1b14cfbc57a12ea2d997b93735a99f70d810 (patch) | |
tree | 1c1a514500be4b0f290e9c9299575e3eb135f3c3 /drivers/usb/chipidea/ci_hdrc_imx.c | |
parent | 73dea4a912b2bfe955305de4891018f9e71e399d (diff) | |
download | linux-a4cf1b14cfbc57a12ea2d997b93735a99f70d810.tar.bz2 |
usb: chipidea: imx: simplify the usbmisc callers
Move struct imx_usbmisc_data NULL pointer judgement from caller to
each API, it can simplify the caller.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/ci_hdrc_imx.c')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 421651060f8d..353989e5675b 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -149,13 +149,10 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) if (ret) goto err_clk; - if (data->usbmisc_data) { - ret = imx_usbmisc_init(data->usbmisc_data); - if (ret) { - dev_err(&pdev->dev, "usbmisc init failed, ret=%d\n", - ret); - goto err_clk; - } + ret = imx_usbmisc_init(data->usbmisc_data); + if (ret) { + dev_err(&pdev->dev, "usbmisc init failed, ret=%d\n", ret); + goto err_clk; } data->ci_pdev = ci_hdrc_add_device(&pdev->dev, @@ -169,13 +166,10 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) goto err_clk; } - if (data->usbmisc_data) { - ret = imx_usbmisc_init_post(data->usbmisc_data); - if (ret) { - dev_err(&pdev->dev, "usbmisc post failed, ret=%d\n", - ret); - goto disable_device; - } + ret = imx_usbmisc_init_post(data->usbmisc_data); + if (ret) { + dev_err(&pdev->dev, "usbmisc post failed, ret=%d\n", ret); + goto disable_device; } platform_set_drvdata(pdev, data); |