Skip to content
Commit 423de5b5 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

thermal/of: Fix cdev lookup in thermal_of_should_bind()

Since thermal_of_should_bind() terminates the loop after processing
the first child found in cooling-maps, it will never match more than
one cdev to a given trip point which is incorrect, as there may be
cooling-maps associating one trip point with multiple cooling devices.

Address this by letting the loop continue until either all
children have been processed or a matching one has been found.

To avoid adding conditionals or goto statements, put the loop in
question into a separate function and make that function return
right away after finding a matching cooling-maps entry.

Fixes: 94c6110b ("thermal/of: Use the .should_bind() thermal zone callback")
Link: https://lore.kernel.org/linux-pm/20250219-fix-thermal-of-v1-1-de36e7a590c4@chromium.org/


Reported-by: default avatarYu-Che Cheng <giver@chromium.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarYu-Che Cheng <giver@chromium.org>
Tested-by: default avatarYu-Che Cheng <giver@chromium.org>
Reviewed-by: Lukasz Luba's avatarLukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba's avatarLukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/2788228.mvXUDI8C0e@rjwysocki.net
parent 4ecaa757
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment