Lines Matching full:match
41 struct component_match *match; member
65 struct component_match *match = m->match; in component_devices_show() local
76 for (i = 0; i < match->num; i++) { in component_devices_show()
77 struct component *component = match->compare[i].component; in component_devices_show()
162 struct component_match *match = master->match; in find_components() local
167 * Scan the array of match functions and attach in find_components()
170 for (i = 0; i < match->num; i++) { in find_components()
171 struct component_match_array *mc = &match->compare[i]; in find_components()
176 if (match->compare[i].component) in find_components()
188 match->compare[i].duplicate = !!c->master; in find_components()
189 match->compare[i].component = c; in find_components()
201 for (i = 0; i < master->match->num; i++) in remove_component()
202 if (master->match->compare[i].component == c) in remove_component()
203 master->match->compare[i].component = NULL; in remove_component()
273 struct component_match *match) in component_match_release() argument
277 for (i = 0; i < match->num; i++) { in component_match_release()
278 struct component_match_array *mc = &match->compare[i]; in component_match_release()
284 kfree(match->compare); in component_match_release()
293 struct component_match *match, size_t num) in component_match_realloc() argument
297 if (match->alloc == num) in component_match_realloc()
304 if (match->compare) { in component_match_realloc()
305 memcpy(new, match->compare, sizeof(*new) * in component_match_realloc()
306 min(match->num, num)); in component_match_realloc()
307 kfree(match->compare); in component_match_realloc()
309 match->compare = new; in component_match_realloc()
310 match->alloc = num; in component_match_realloc()
318 * The match array is first created or extended if necessary.
325 struct component_match *match = *matchptr; in component_match_add_release() local
327 if (IS_ERR(match)) in component_match_add_release()
330 if (!match) { in component_match_add_release()
331 match = devres_alloc(devm_component_match_release, in component_match_add_release()
332 sizeof(*match), GFP_KERNEL); in component_match_add_release()
333 if (!match) { in component_match_add_release()
338 devres_add(master, match); in component_match_add_release()
340 *matchptr = match; in component_match_add_release()
343 if (match->num == match->alloc) { in component_match_add_release()
344 size_t new_size = match->alloc + 16; in component_match_add_release()
347 ret = component_match_realloc(master, match, new_size); in component_match_add_release()
354 match->compare[match->num].compare = compare; in component_match_add_release()
355 match->compare[match->num].release = release; in component_match_add_release()
356 match->compare[match->num].data = compare_data; in component_match_add_release()
357 match->compare[match->num].component = NULL; in component_match_add_release()
358 match->num++; in component_match_add_release()
364 struct component_match *match = master->match; in free_master() local
370 if (match) { in free_master()
371 for (i = 0; i < match->num; i++) { in free_master()
372 struct component *c = match->compare[i].component; in free_master()
383 struct component_match *match) in component_master_add_with_match() argument
388 /* Reallocate the match array for its true size */ in component_master_add_with_match()
389 ret = component_match_realloc(dev, match, match->num); in component_master_add_with_match()
399 master->match = match; in component_master_add_with_match()
457 for (i = master->match->num; i--; ) in component_unbind_all()
458 if (!master->match->compare[i].duplicate) { in component_unbind_all()
459 c = master->match->compare[i].component; in component_unbind_all()
531 /* Bind components in match order */ in component_bind_all()
532 for (i = 0; i < master->match->num; i++) in component_bind_all()
533 if (!master->match->compare[i].duplicate) { in component_bind_all()
534 c = master->match->compare[i].component; in component_bind_all()
542 if (!master->match->compare[i - 1].duplicate) { in component_bind_all()
543 c = master->match->compare[i - 1].component; in component_bind_all()