diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-04-23 05:46:11 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-12-06 19:02:04 -0500 |
commit | 29f1c7fd61a31e0335ce41d4b2788959ad7c468d (patch) | |
tree | dc329e21451e220b2e29357348d261d9d7a188fc /drivers/base/component.c | |
parent | fae9e2e07af07baabb8c26a31b3f7d8fdf89809e (diff) |
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.c | 15 |
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, | |||
150 | { | 150 | { |
151 | int ret; | 151 | int ret; |
152 | 152 | ||
153 | if (master->bound) | ||
154 | return 0; | ||
155 | |||
156 | /* | ||
157 | * Search the list of components, looking for components that | ||
158 | * belong to this master, and attach them to the master. | ||
159 | */ | ||
160 | if (find_components(master)) { | 153 | if (find_components(master)) { |
161 | /* Failed to find all components */ | 154 | /* Failed to find all components */ |
162 | ret = 0; | 155 | ret = 0; |
@@ -196,9 +189,11 @@ static int try_to_bring_up_masters(struct component *component) | |||
196 | int ret = 0; | 189 | int ret = 0; |
197 | 190 | ||
198 | list_for_each_entry(m, &masters, node) { | 191 | list_for_each_entry(m, &masters, node) { |
199 | ret = try_to_bring_up_master(m, component); | 192 | if (!m->bound) { |
200 | if (ret != 0) | 193 | ret = try_to_bring_up_master(m, component); |
201 | break; | 194 | if (ret != 0) |
195 | break; | ||
196 | } | ||
202 | } | 197 | } |
203 | 198 | ||
204 | return ret; | 199 | return ret; |