thermal: Fix thermal_zone_of_sensor_register to match documentation
authorPunit Agrawal <punit.agrawal@arm.com>
Tue, 8 Sep 2015 13:51:12 +0000 (14:51 +0100)
committerEduardo Valentin <edubezval@gmail.com>
Mon, 14 Sep 2015 02:33:07 +0000 (19:33 -0700)
thermal_zone_of_sensor_register is documented as returning a pointer
to either a valid thermal_zone_device on success, or a corresponding
ERR_PTR() value.

In contrast, the function returns NULL when THERMAL_OF is configured
off. Fix this.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
include/linux/thermal.h

index 17292fee868659411f6c8797cb540f978921b034..0c5518e135840517141a3ba18044a607a388721f 100644 (file)
@@ -360,7 +360,7 @@ static inline struct thermal_zone_device *
 thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
                                const struct thermal_zone_of_device_ops *ops)
 {
-       return NULL;
+       return ERR_PTR(-ENODEV);
 }
 
 static inline