pinctrl: tegra: uphy: fix Coverity issues
Deepak Nibade [Tue, 19 May 2015 09:24:59 +0000 (14:24 +0530)]
remove logically dead code by using proper error check
on pointer
Coverity defect id : 30101

fix unsigned comparison against zero by declaring variable
"value" as int
Coverity defect id : 30105

Bug 1416640

Change-Id: I7acf0fa2f8726a9e5148a4cd07300ad2575b4760
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/744276
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

drivers/pinctrl/pinctrl-tegra186-padctl-uphy.c

index d300a82..677c160 100644 (file)
@@ -1810,7 +1810,7 @@ static int tegra_xusb_padctl_pinconf_group_get(struct pinctrl_dev *pinctrl,
        struct tegra_padctl_uphy *padctl = pinctrl_dev_get_drvdata(pinctrl);
        const struct tegra_padctl_uphy_lane *lane;
        enum tegra_xusb_padctl_param param;
-       u32 value = 0;
+       int value = 0;
        int port;
 
        param = TEGRA_XUSB_PADCTL_UNPACK_PARAM(*config);
@@ -3367,7 +3367,7 @@ static int tegra186_padctl_uphy_probe(struct platform_device *pdev)
        TRACE();
        ctx->provider = devm_of_phy_provider_register(&pdev->dev,
                                        tegra186_padctl_uphy_xlate);
-       if (err < 0) {
+       if (IS_ERR(ctx->provider)) {
                dev_err(&pdev->dev, "failed to register PHYs: %d\n", err);
                goto unregister;
        }