Lines Matching full:match

38  * Aggregate drivers first assemble a component match list of what they need
67 struct component_match *match; member
91 struct component_match *match = m->match; in component_devices_show() local
102 for (i = 0; i < match->num; i++) { in component_devices_show()
103 struct component *component = match->compare[i].component; in component_devices_show()
180 struct component_match *match = master->match; in find_components() local
185 * Scan the array of match functions and attach in find_components()
188 for (i = 0; i < match->num; i++) { in find_components()
189 struct component_match_array *mc = &match->compare[i]; in find_components()
194 if (match->compare[i].component) in find_components()
206 match->compare[i].duplicate = !!c->master; in find_components()
207 match->compare[i].component = c; in find_components()
219 for (i = 0; i < master->match->num; i++) in remove_component()
220 if (master->match->compare[i].component == c) in remove_component()
221 master->match->compare[i].component = NULL; in remove_component()
292 struct component_match *match = res; in devm_component_match_release() local
295 for (i = 0; i < match->num; i++) { in devm_component_match_release()
296 struct component_match_array *mc = &match->compare[i]; in devm_component_match_release()
302 kfree(match->compare); in devm_component_match_release()
305 static int component_match_realloc(struct component_match *match, size_t num) in component_match_realloc() argument
309 if (match->alloc == num) in component_match_realloc()
316 if (match->compare) { in component_match_realloc()
317 memcpy(new, match->compare, sizeof(*new) * in component_match_realloc()
318 min(match->num, num)); in component_match_realloc()
319 kfree(match->compare); in component_match_realloc()
321 match->compare = new; in component_match_realloc()
322 match->alloc = num; in component_match_realloc()
334 struct component_match *match = *matchptr; in __component_match_add() local
336 if (IS_ERR(match)) in __component_match_add()
339 if (!match) { in __component_match_add()
340 match = devres_alloc(devm_component_match_release, in __component_match_add()
341 sizeof(*match), GFP_KERNEL); in __component_match_add()
342 if (!match) { in __component_match_add()
347 devres_add(master, match); in __component_match_add()
349 *matchptr = match; in __component_match_add()
352 if (match->num == match->alloc) { in __component_match_add()
353 size_t new_size = match->alloc + 16; in __component_match_add()
356 ret = component_match_realloc(match, new_size); in __component_match_add()
363 match->compare[match->num].compare = compare; in __component_match_add()
364 match->compare[match->num].compare_typed = compare_typed; in __component_match_add()
365 match->compare[match->num].release = release; in __component_match_add()
366 match->compare[match->num].data = compare_data; in __component_match_add()
367 match->compare[match->num].component = NULL; in __component_match_add()
368 match->num++; in __component_match_add()
372 * component_match_add_release - add a component match entry with release callback
376 * @compare: compare function to match against all components
379 * Adds a new component match to the list stored in @matchptr, which the @master
381 * by @matchptr must be initialized to NULL before adding the first match. This
384 * The allocated match list in @matchptr is automatically released using devm
402 * component_match_add_typed - add a component match entry for a typed component
405 * @compare_typed: compare function to match against all typed components
408 * Adds a new component match to the list stored in @matchptr, which the @master
410 * by @matchptr must be initialized to NULL before adding the first match. This
413 * The allocated match list in @matchptr is automatically released using devm
429 struct component_match *match = master->match; in free_master() local
435 if (match) { in free_master()
436 for (i = 0; i < match->num; i++) { in free_master()
437 struct component *c = match->compare[i].component; in free_master()
450 * @match: component match list for the aggregate driver
452 * Registers a new aggregate driver consisting of the components added to @match
454 * @match are available, it will be assembled by calling
460 struct component_match *match) in component_master_add_with_match() argument
465 /* Reallocate the match array for its true size */ in component_master_add_with_match()
466 ret = component_match_realloc(match, match->num); in component_master_add_with_match()
476 master->match = match; in component_master_add_with_match()
553 for (i = master->match->num; i--; ) in component_unbind_all()
554 if (!master->match->compare[i].duplicate) { in component_unbind_all()
555 c = master->match->compare[i].component; in component_unbind_all()
636 /* Bind components in match order */ in component_bind_all()
637 for (i = 0; i < master->match->num; i++) in component_bind_all()
638 if (!master->match->compare[i].duplicate) { in component_bind_all()
639 c = master->match->compare[i].component; in component_bind_all()
647 if (!master->match->compare[i - 1].duplicate) { in component_bind_all()
648 c = master->match->compare[i - 1].component; in component_bind_all()
700 * components registerd on the same device @dev. These components are match