• Home
  • Raw
  • Download

Lines Matching full:component

5  * This is work in progress.  We gather up the component devices into a list,
10 #include <linux/component.h>
19 struct component;
25 struct component *component; member
45 struct component { struct
77 struct component *component = match->compare[i].component; in component_devices_show() local
80 component ? dev_name(component->dev) : "(unknown)", in component_devices_show()
81 component ? (component->bound ? "bound" : "not bound") : "not registered"); in component_devices_show()
144 static struct component *find_component(struct master *master, in find_component()
147 struct component *c; in find_component()
172 struct component *c; in find_components()
174 dev_dbg(master->dev, "Looking for component %zu\n", i); in find_components()
176 if (match->compare[i].component) in find_components()
185 dev_dbg(master->dev, "found component %s, duplicate %u\n", dev_name(c->dev), !!c->master); in find_components()
187 /* Attach this component to the master */ in find_components()
189 match->compare[i].component = c; in find_components()
195 /* Detach component from associated master */
196 static void remove_component(struct master *master, struct component *c) in remove_component()
200 /* Detach the component from this master. */ in remove_component()
202 if (master->match->compare[i].component == c) in remove_component()
203 master->match->compare[i].component = NULL; in remove_component()
207 * Try to bring up a master. If component is NULL, we're interested in
208 * this master, otherwise it's a component which must be present to try
214 struct component *component) in try_to_bring_up_master() argument
225 if (component && component->master != master) { in try_to_bring_up_master()
226 dev_dbg(master->dev, "master is not for this component (%s)\n", in try_to_bring_up_master()
227 dev_name(component->dev)); in try_to_bring_up_master()
247 static int try_to_bring_up_masters(struct component *component) in try_to_bring_up_masters() argument
254 ret = try_to_bring_up_master(m, component); in try_to_bring_up_masters()
316 * Add a component to be matched, with a release function.
357 match->compare[match->num].component = NULL; in component_match_add_release()
372 struct component *c = match->compare[i].component; in free_master()
432 static void component_unbind(struct component *component, in component_unbind() argument
435 WARN_ON(!component->bound); in component_unbind()
437 component->ops->unbind(component->dev, master->dev, data); in component_unbind()
438 component->bound = false; in component_unbind()
440 /* Release all resources claimed in the binding of this component */ in component_unbind()
441 devres_release_group(component->dev, component); in component_unbind()
447 struct component *c; in component_unbind_all()
459 c = master->match->compare[i].component; in component_unbind_all()
465 static int component_bind(struct component *component, struct master *master, in component_bind() argument
471 * Each component initialises inside its own devres group. in component_bind()
472 * This allows us to roll-back a failed component without in component_bind()
483 if (!devres_open_group(component->dev, component, GFP_KERNEL)) { in component_bind()
489 dev_name(component->dev), component->ops); in component_bind()
491 ret = component->ops->bind(component->dev, master->dev, data); in component_bind()
493 component->bound = true; in component_bind()
496 * Close the component device's group so that resources in component_bind()
501 devres_close_group(component->dev, NULL); in component_bind()
505 dev_name(component->dev), component->ops); in component_bind()
507 devres_release_group(component->dev, NULL); in component_bind()
512 dev_name(component->dev), component->ops, ret); in component_bind()
521 struct component *c; in component_bind_all()
534 c = master->match->compare[i].component; in component_bind_all()
543 c = master->match->compare[i - 1].component; in component_bind_all()
554 struct component *component; in component_add() local
557 component = kzalloc(sizeof(*component), GFP_KERNEL); in component_add()
558 if (!component) in component_add()
561 component->ops = ops; in component_add()
562 component->dev = dev; in component_add()
564 dev_dbg(dev, "adding component (ops %ps)\n", ops); in component_add()
567 list_add_tail(&component->node, &component_list); in component_add()
569 ret = try_to_bring_up_masters(component); in component_add()
571 if (component->master) in component_add()
572 remove_component(component->master, component); in component_add()
573 list_del(&component->node); in component_add()
575 kfree(component); in component_add()
585 struct component *c, *component = NULL; in component_del() local
591 component = c; in component_del()
595 if (component && component->master) { in component_del()
596 take_down_master(component->master); in component_del()
597 remove_component(component->master, component); in component_del()
602 WARN_ON(!component); in component_del()
603 kfree(component); in component_del()