* registering function checked the ops are correctly set
*/
ret = cdev->ops->set_cur_state(cdev, state);
- if (!ret) {
- thermal_notify_cdev_state_update(cdev, state);
- thermal_cooling_device_stats_update(cdev, state);
- thermal_debug_cdev_state_update(cdev, state);
- }
+ if (ret)
+ return ret;
- return ret;
+ thermal_notify_cdev_state_update(cdev, state);
+ thermal_cooling_device_stats_update(cdev, state);
+ thermal_debug_cdev_state_update(cdev, state);
+
+ return 0;
}
void __thermal_cdev_update(struct thermal_cooling_device *cdev)