Commit a094ccf
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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Jonathan 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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>1 parent 69f3aa6 commit a094ccf
1 file changed
+7
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
104 | | - | |
| 102 | + | |
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
119 | 113 | | |
120 | 114 | | |
121 | 115 | | |
122 | 116 | | |
123 | 117 | | |
124 | | - | |
| 118 | + | |
125 | 119 | | |
126 | 120 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 121 | + | |
135 | 122 | | |
136 | | - | |
| 123 | + | |
137 | 124 | | |
138 | 125 | | |
139 | 126 | | |
| |||
0 commit comments