]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: video-i2c: hwmon: fix return value from amg88xx_hwmon_init()
authorMatt Ranostay <matt.ranostay@konsulko.com>
Fri, 27 Jul 2018 01:47:24 +0000 (21:47 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 27 Jul 2018 12:10:34 +0000 (08:10 -0400)
PTR_ERR was making any pointer passed an error pointer, and should be
replaced with PTR_ERR_OR_ZERO which checks if is an actual error condition.

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/video-i2c.c

index 7dc9338502e5ccd308fbaa850853d1b99961176b..06d29d8f6be8ed8e7cb7c7418c58643e6a9eda58 100644 (file)
@@ -167,7 +167,7 @@ static int amg88xx_hwmon_init(struct video_i2c_data *data)
        void *hwmon = devm_hwmon_device_register_with_info(&data->client->dev,
                                "amg88xx", data, &amg88xx_chip_info, NULL);
 
-       return PTR_ERR(hwmon);
+       return PTR_ERR_OR_ZERO(hwmon);
 }
 #else
 #define        amg88xx_hwmon_init      NULL