From 17f330ce9e434333a98b0fbc7b6d5ddbe0cc6770 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Thu, 26 Jul 2018 21:47:24 -0400 Subject: [PATCH] media: video-i2c: hwmon: fix return value from amg88xx_hwmon_init() 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/video-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 7dc9338..06d29d8 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -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 -- 2.7.4