Commit fd881eac authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

thermal: helpers: Rearrange thermal_cdev_set_cur_state()



Change the code layout in thermal_cdev_set_cur_state() so it returns
early on errors which is more consistent with what happens elsewhere.

No intentional functional impact.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 11fde939
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -155,13 +155,14 @@ static int thermal_cdev_set_cur_state(struct thermal_cooling_device *cdev, int s
	 * registering function checked the ops are correctly set
	 */
	ret = cdev->ops->set_cur_state(cdev, state);
	if (!ret) {
	if (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 ret;
	return 0;
}

void __thermal_cdev_update(struct thermal_cooling_device *cdev)