Commit a094ccfa authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Rafael J. Wysocki
Browse files

thermal: of: Use scoped memory and OF handling to simplify thermal_of_trips_init()



Obtain the device node reference and allocate memory with
scoped/cleanup.h to reduce error handling and make the code a bit
simpler.

The code is not equivalent in one minor aspect: outgoing parameter
"*ntrips" will not be zeroed on errors of memory allocation.  This
difference is not important, because code was already not zeroing it in
case of earlier errors and the only caller does not rely on ntrips being
0 in case of errors.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://patch.msgid.link/20241010-b4-cleanup-h-of-node-put-thermal-v4-2-bfbe29ad81f4@linaro.org


[ rjw: Rebase ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 69f3aa6a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment