Lines Matching refs:match

33  * Aggregate drivers first assemble a component match list of what they need
62 struct component_match *match;
86 struct component_match *match = m->match;
97 for (i = 0; i < match->num; i++) {
98 struct component *component = match->compare[i].component;
175 struct component_match *match = adev->match;
180 * Scan the array of match functions and attach
183 for (i = 0; i < match->num; i++) {
184 struct component_match_array *mc = &match->compare[i];
189 if (match->compare[i].component)
202 match->compare[i].duplicate = !!c->adev;
203 match->compare[i].component = c;
215 for (i = 0; i < adev->match->num; i++)
216 if (adev->match->compare[i].component == c)
217 adev->match->compare[i].component = NULL;
293 * component_match_add_release(masterdev, &match, component_release_of,
321 * component_match_add(masterdev, &match, component_compare_dev, component_dev)
335 * component_match_add(masterdev, &match, component_compare_dev_name,
346 struct component_match *match = res;
349 for (i = 0; i < match->num; i++) {
350 struct component_match_array *mc = &match->compare[i];
356 kfree(match->compare);
359 static int component_match_realloc(struct component_match *match, size_t num)
363 if (match->alloc == num)
370 if (match->compare) {
371 memcpy(new, match->compare, sizeof(*new) *
372 min(match->num, num));
373 kfree(match->compare);
375 match->compare = new;
376 match->alloc = num;
388 struct component_match *match = *matchptr;
390 if (IS_ERR(match))
393 if (!match) {
394 match = devres_alloc(devm_component_match_release,
395 sizeof(*match), GFP_KERNEL);
396 if (!match) {
401 devres_add(parent, match);
403 *matchptr = match;
406 if (match->num == match->alloc) {
407 size_t new_size = match->alloc + 16;
410 ret = component_match_realloc(match, new_size);
417 match->compare[match->num].compare = compare;
418 match->compare[match->num].compare_typed = compare_typed;
419 match->compare[match->num].release = release;
420 match->compare[match->num].data = compare_data;
421 match->compare[match->num].component = NULL;
422 match->num++;
426 * component_match_add_release - add a component match entry with release callback
430 * @compare: compare function to match against all components
433 * Adds a new component match to the list stored in @matchptr, which the
435 * by @matchptr must be initialized to NULL before adding the first match. This
438 * The allocated match list in @matchptr is automatically released using devm
456 * component_match_add_typed - add a component match entry for a typed component
459 * @compare_typed: compare function to match against all typed components
462 * Adds a new component match to the list stored in @matchptr, which the
464 * by @matchptr must be initialized to NULL before adding the first match. This
467 * The allocated match list in @matchptr is automatically released using devm
483 struct component_match *match = adev->match;
489 if (match) {
490 for (i = 0; i < match->num; i++) {
491 struct component *c = match->compare[i].component;
504 * @match: component match list for the aggregate driver
506 * Registers a new aggregate driver consisting of the components added to @match
508 * @match are available, it will be assembled by calling
514 struct component_match *match)
519 /* Reallocate the match array for its true size */
520 ret = component_match_realloc(match, match->num);
530 adev->match = match;
607 for (i = adev->match->num; i--; )
608 if (!adev->match->compare[i].duplicate) {
609 c = adev->match->compare[i].component;
690 /* Bind components in match order */
691 for (i = 0; i < adev->match->num; i++)
692 if (!adev->match->compare[i].duplicate) {
693 c = adev->match->compare[i].component;
701 if (!adev->match->compare[i - 1].duplicate) {
702 c = adev->match->compare[i - 1].component;
754 * components registered on the same device @dev. These components are match