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>
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