media: tegra: fix regulator_get return value check
Mallikarjun Kasoju [Fri, 22 Nov 2013 10:23:28 +0000 (15:23 +0530)]
regulator_get() returns either error pointer or valid pointers.
It never returns NULL. Hence it is not a correct to check
the return pointer as IS_ERR_OR_NULL(). It should be only IS_ERR().

Bug 1410234

Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>

Change-Id: Ic1caa1433f4ee9b49eca3309970cac82d1ab7d6a
Reviewed-on: http://git-master/r/334473
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Tested-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/media/platform/tegra/ad5820.c
drivers/media/platform/tegra/ar0832_main.c
drivers/media/platform/tegra/as364x.c
drivers/media/platform/tegra/cam_dev/dev_access.c
drivers/media/platform/tegra/imx135.c
drivers/media/platform/tegra/lm3565.c
drivers/media/platform/tegra/max77387.c
drivers/media/platform/tegra/max77665-flash.c
drivers/media/platform/tegra/ov9726.c
drivers/media/platform/tegra/sh532u.c
drivers/media/platform/tegra/tps61050.c

index ba3fa98..254370b 100644 (file)
@@ -173,7 +173,7 @@ static int ad5820_probe(struct i2c_client *client,
        }
 
        info->regulator = regulator_get(&client->dev, "vdd_vcore_af");
-       if (IS_ERR_OR_NULL(info->regulator)) {
+       if (IS_ERR(info->regulator)) {
                dev_err(&client->dev, "unable to get regulator %s\n",
                        dev_name(&client->dev));
                info->regulator = NULL;
index 2c05e97..b9b8228 100644 (file)
@@ -2663,7 +2663,7 @@ static int ar0832_probe(struct i2c_client *client,
        }
 
        dev->power_rail.sen_1v8_reg = regulator_get(&client->dev, "vdd");
-       if (IS_ERR_OR_NULL(dev->power_rail.sen_1v8_reg)) {
+       if (IS_ERR(dev->power_rail.sen_1v8_reg)) {
                dev_err(&client->dev, "%s: failed to get vdd\n",
                        __func__);
                ret = PTR_ERR(dev->power_rail.sen_1v8_reg);
@@ -2671,7 +2671,7 @@ static int ar0832_probe(struct i2c_client *client,
        }
 
        dev->power_rail.sen_2v8_reg = regulator_get(&client->dev, "vaa");
-       if (IS_ERR_OR_NULL(dev->power_rail.sen_2v8_reg)) {
+       if (IS_ERR(dev->power_rail.sen_2v8_reg)) {
                dev_err(&client->dev, "%s: failed to get vaa\n",
                        __func__);
                ret = PTR_ERR(dev->power_rail.sen_2v8_reg);
index e2201d9..4ffb270 100644 (file)
@@ -1422,7 +1422,7 @@ static int as364x_regulator_get(struct as364x_info *info,
        int err = 0;
 
        reg = regulator_get(info->dev, vreg_name);
-       if (unlikely(IS_ERR_OR_NULL(reg))) {
+       if (unlikely(IS_ERR(reg))) {
                dev_err(info->dev,
                        "%s %s ERR: %d\n", __func__, vreg_name, (int)reg);
                err = PTR_ERR(reg);
index 99fdecb..774d6e2 100644 (file)
@@ -367,7 +367,7 @@ int camera_regulator_get(struct device *dev,
                return -ENODEV;
        }
        reg = regulator_get(dev, vreg_name);
-       if (unlikely(IS_ERR_OR_NULL(reg))) {
+       if (unlikely(IS_ERR(reg))) {
                dev_notice(dev, "%s %s not there: %d\n",
                        __func__, vreg_name, (int)reg);
                err = PTR_ERR(reg);
index 5abcb08..038f91b 100644 (file)
@@ -3632,7 +3632,7 @@ static int imx135_regulator_get(struct imx135_info *info,
        int err = 0;
 
        reg = regulator_get(&info->i2c_client->dev, vreg_name);
-       if (unlikely(IS_ERR_OR_NULL(reg))) {
+       if (unlikely(IS_ERR(reg))) {
                dev_err(&info->i2c_client->dev, "%s %s ERR: %d\n",
                        __func__, vreg_name, (int)reg);
                err = PTR_ERR(reg);
index 9143108..5fe30b7 100644 (file)
@@ -1236,7 +1236,7 @@ static int lm3565_regulator_get(struct lm3565_info *info,
        int err = 0;
 
        reg = regulator_get(info->dev, vreg_name);
-       if (unlikely(IS_ERR_OR_NULL(reg))) {
+       if (unlikely(IS_ERR(reg))) {
                dev_err(info->dev, "%s %s ERR: %d\n",
                        __func__, vreg_name, (int)reg);
                err = PTR_ERR(reg);
index 68b377c..a6174b4 100644 (file)
@@ -1668,7 +1668,7 @@ static int max77387_regulator_get(struct max77387_info *info,
        int err = 0;
 
        reg = regulator_get(info->dev, vreg_name);
-       if (unlikely(IS_ERR_OR_NULL(reg))) {
+       if (unlikely(IS_ERR(reg))) {
                dev_err(info->dev, "%s %s ERR: %d\n",
                        __func__, vreg_name, (int)reg);
                err = PTR_ERR(reg);
index b441a82..8ac4186 100644 (file)
@@ -1487,7 +1487,7 @@ static int max77665_f_regulator_get(struct max77665_f_info *info,
        int err = 0;
 
        reg = regulator_get(info->dev, vreg_name);
-       if (unlikely(IS_ERR_OR_NULL(reg))) {
+       if (unlikely(IS_ERR(reg))) {
                dev_err(info->dev, "%s %s ERR: %d\n",
                        __func__, vreg_name, (int)reg);
                err = PTR_ERR(reg);
index 18ab4cd..1bb9468 100644 (file)
@@ -295,7 +295,7 @@ ov9726_power_init(struct ov9726_devinfo *dev)
        int err = 0;
 
        dev->power_rail.sen_1v8_reg = regulator_get(&i2c_client->dev, "dovdd");
-       if (IS_ERR_OR_NULL(dev->power_rail.sen_1v8_reg)) {
+       if (IS_ERR(dev->power_rail.sen_1v8_reg)) {
                dev_err(&i2c_client->dev, "%s: failed to get vdd\n",
                        __func__);
                err = PTR_ERR(dev->power_rail.sen_1v8_reg);
@@ -303,7 +303,7 @@ ov9726_power_init(struct ov9726_devinfo *dev)
        }
 
        dev->power_rail.sen_2v8_reg = regulator_get(&i2c_client->dev, "avdd");
-       if (IS_ERR_OR_NULL(dev->power_rail.sen_2v8_reg)) {
+       if (IS_ERR(dev->power_rail.sen_2v8_reg)) {
                dev_err(&i2c_client->dev, "%s: failed to get vaa\n",
                        __func__);
                err = PTR_ERR(dev->power_rail.sen_2v8_reg);
index af1b304..4cf4c0e 100644 (file)
@@ -534,7 +534,7 @@ static int sh532u_vreg_init(struct sh532u_info *info)
                info->vreg[j].vreg_flag = false;
                info->vreg[j].vreg = regulator_get(&info->i2c_client->dev,
                                                   info->vreg[j].vreg_name);
-               if (IS_ERR_OR_NULL(info->vreg[j].vreg)) {
+               if (IS_ERR(info->vreg[j].vreg)) {
                        if (PTR_ERR(info->vreg[j].vreg) != -ENODEV)
                                dev_dbg(&info->i2c_client->dev,
                                        "%s %s ERR: %d\n",
index 913537a..fc9516d 100644 (file)
@@ -220,7 +220,7 @@ static int tps61050_pm_regulator_get(struct tps61050_info *info,
 
        sreg->vreg_flag = 0;
        sreg->vreg = regulator_get(&info->i2c_client->dev, vreg_name);
-       if (IS_ERR_OR_NULL(sreg->vreg)) {
+       if (IS_ERR(sreg->vreg)) {
                dev_err(&info->i2c_client->dev,
                                "%s err for regulator: %s err: %d\n",
                                __func__, vreg_name, (int)sreg->vreg);