media: i2c/ov8865.c: fix error checks using wrong variable
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 20 Jan 2021 08:42:38 +0000 (09:42 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 27 Jan 2021 07:33:30 +0000 (08:33 +0100)
Fix two typos: dvdd -> dovdd and dvdd -> avdd

Both clearly copy-and-paste mistakes.

Fixes this smatch warning:

drivers/media/i2c/ov8865.c:2852 ov8865_probe() warn: passing zero to 'PTR_ERR'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/ov8865.c

index ab4804d..b2099e3 100644 (file)
@@ -2839,9 +2839,9 @@ static int ov8865_probe(struct i2c_client *client)
 
        /* DOVDD: digital I/O */
        sensor->dovdd = devm_regulator_get(dev, "dovdd");
-       if (IS_ERR(sensor->dvdd)) {
+       if (IS_ERR(sensor->dovdd)) {
                dev_err(dev, "cannot get DOVDD (digital I/O) regulator\n");
-               ret = PTR_ERR(sensor->dvdd);
+               ret = PTR_ERR(sensor->dovdd);
                goto error_endpoint;
        }
 
@@ -2849,7 +2849,7 @@ static int ov8865_probe(struct i2c_client *client)
        sensor->avdd = devm_regulator_get(dev, "avdd");
        if (IS_ERR(sensor->avdd)) {
                dev_err(dev, "cannot get AVDD (analog) regulator\n");
-               ret = PTR_ERR(sensor->dvdd);
+               ret = PTR_ERR(sensor->avdd);
                goto error_endpoint;
        }