summaryrefslogtreecommitdiffstats
path: root/drivers/base/component.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-04-23 11:46:11 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-12-07 01:02:04 +0100
commit29f1c7fd61a31e0335ce41d4b2788959ad7c468d (patch)
treedc329e21451e220b2e29357348d261d9d7a188fc /drivers/base/component.c
parentcomponent: remove old add_components method (diff)
downloadlinux-29f1c7fd61a31e0335ce41d4b2788959ad7c468d.tar.xz
linux-29f1c7fd61a31e0335ce41d4b2788959ad7c468d.zip
component: move check for unbound master into try_to_bring_up_masters()
Clean up the code a little; we don't need to check that the master is unbound for every invocation of try_to_bring_up_master(), so let's move it to where it's really needed - try_to_bring_up_masters(), where we may encounter already bound masters. Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/base/component.c')
-rw-r--r--drivers/base/component.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/base/component.c b/drivers/base/component.c
index 2ca22738ae92..cd70b68d9780 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -150,13 +150,6 @@ static int try_to_bring_up_master(struct master *master,
{
int ret;
- if (master->bound)
- return 0;
-
- /*
- * Search the list of components, looking for components that
- * belong to this master, and attach them to the master.
- */
if (find_components(master)) {
/* Failed to find all components */
ret = 0;
@@ -196,9 +189,11 @@ static int try_to_bring_up_masters(struct component *component)
int ret = 0;
list_for_each_entry(m, &masters, node) {
- ret = try_to_bring_up_master(m, component);
- if (ret != 0)
- break;
+ if (!m->bound) {
+ ret = try_to_bring_up_master(m, component);
+ if (ret != 0)
+ break;
+ }
}
return ret;