misc: tegra-baseband: fix coverity defect
BH Hsieh [Wed, 30 Sep 2015 04:48:07 +0000 (12:48 +0800)]
fix coverity defect CID 19864
caused by http://git-master/r/453975

Bug 1416640

Change-Id: Ia739024f55e0a75037503fe3d95db86e62be30e3
Signed-off-by: BH Hsieh <bhsieh@nvidia.com>
Reviewed-on: http://git-master/r/807182
(cherry picked from commit 92bac217c5c1df83829db8b5f52b8f84744f224f)
Reviewed-on: http://git-master/r/812732
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Steve Lin <stlin@nvidia.com>

drivers/misc/tegra-baseband/tegra_usb_modem_power.c

index 80106ef..c3ddf02 100644 (file)
@@ -529,14 +529,17 @@ static int mdm_request_irq(struct tegra_usb_modem *modem,
 static struct platform_device *tegra_usb_host_register(
                                const struct tegra_usb_modem *modem)
 {
-       const struct platform_device *hc_device =
-           modem->pdata->tegra_ehci_device;
        struct platform_device *pdev;
-       int val;
 
 #if defined(CONFIG_ARCH_TEGRA_21x_SOC)
        struct property *status_prop;
+#else
+       const struct platform_device *hc_device =
+           modem->pdata->tegra_ehci_device;
+       int val;
+#endif
 
+#if defined(CONFIG_ARCH_TEGRA_21x_SOC)
        /* we're registering EHCI through DT here */
 
        /* If ehci node is unavailable, we're unable to register it later.
@@ -562,7 +565,7 @@ static struct platform_device *tegra_usb_host_register(
        }
 
        return pdev;
-#endif
+#else
 
        pdev = platform_device_alloc(hc_device->name, hc_device->id);
        if (!pdev)
@@ -591,6 +594,7 @@ error:
        pr_err("%s: err %d\n", __func__, val);
        platform_device_put(pdev);
        return NULL;
+#endif
 }
 
 /* unload USB host controller */