@@ -32,46 +32,6 @@ struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu)
32
32
}
33
33
34
34
#ifdef CONFIG_OF
35
- static int cache_setup_of_node (unsigned int cpu )
36
- {
37
- struct device_node * np ;
38
- struct cacheinfo * this_leaf ;
39
- struct device * cpu_dev = get_cpu_device (cpu );
40
- struct cpu_cacheinfo * this_cpu_ci = get_cpu_cacheinfo (cpu );
41
- unsigned int index = 0 ;
42
-
43
- /* skip if of_node is already populated */
44
- if (this_cpu_ci -> info_list -> of_node )
45
- return 0 ;
46
-
47
- if (!cpu_dev ) {
48
- pr_err ("No cpu device for CPU %d\n" , cpu );
49
- return - ENODEV ;
50
- }
51
- np = cpu_dev -> of_node ;
52
- if (!np ) {
53
- pr_err ("Failed to find cpu%d device node\n" , cpu );
54
- return - ENOENT ;
55
- }
56
-
57
- while (index < cache_leaves (cpu )) {
58
- this_leaf = this_cpu_ci -> info_list + index ;
59
- if (this_leaf -> level != 1 )
60
- np = of_find_next_cache_node (np );
61
- else
62
- np = of_node_get (np );/* cpu node itself */
63
- if (!np )
64
- break ;
65
- this_leaf -> of_node = np ;
66
- index ++ ;
67
- }
68
-
69
- if (index != cache_leaves (cpu )) /* not all OF nodes populated */
70
- return - ENOENT ;
71
-
72
- return 0 ;
73
- }
74
-
75
35
static inline bool cache_leaves_are_shared (struct cacheinfo * this_leaf ,
76
36
struct cacheinfo * sib_leaf )
77
37
{
@@ -202,6 +162,46 @@ static void cache_of_override_properties(unsigned int cpu)
202
162
cache_associativity (this_leaf );
203
163
}
204
164
}
165
+
166
+ static int cache_setup_of_node (unsigned int cpu )
167
+ {
168
+ struct device_node * np ;
169
+ struct cacheinfo * this_leaf ;
170
+ struct device * cpu_dev = get_cpu_device (cpu );
171
+ struct cpu_cacheinfo * this_cpu_ci = get_cpu_cacheinfo (cpu );
172
+ unsigned int index = 0 ;
173
+
174
+ /* skip if of_node is already populated */
175
+ if (this_cpu_ci -> info_list -> of_node )
176
+ return 0 ;
177
+
178
+ if (!cpu_dev ) {
179
+ pr_err ("No cpu device for CPU %d\n" , cpu );
180
+ return - ENODEV ;
181
+ }
182
+ np = cpu_dev -> of_node ;
183
+ if (!np ) {
184
+ pr_err ("Failed to find cpu%d device node\n" , cpu );
185
+ return - ENOENT ;
186
+ }
187
+
188
+ while (index < cache_leaves (cpu )) {
189
+ this_leaf = this_cpu_ci -> info_list + index ;
190
+ if (this_leaf -> level != 1 )
191
+ np = of_find_next_cache_node (np );
192
+ else
193
+ np = of_node_get (np );/* cpu node itself */
194
+ if (!np )
195
+ break ;
196
+ this_leaf -> of_node = np ;
197
+ index ++ ;
198
+ }
199
+
200
+ if (index != cache_leaves (cpu )) /* not all OF nodes populated */
201
+ return - ENOENT ;
202
+
203
+ return 0 ;
204
+ }
205
205
#else
206
206
static void cache_of_override_properties (unsigned int cpu ) { }
207
207
static inline int cache_setup_of_node (unsigned int cpu ) { return 0 ; }
0 commit comments