Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29f1c7fd authored by Russell King's avatar Russell King
Browse files

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: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent fae9e2e0
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -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,10 +189,12 @@ static int try_to_bring_up_masters(struct component *component)
	int ret = 0;

	list_for_each_entry(m, &masters, node) {
		if (!m->bound) {
			ret = try_to_bring_up_master(m, component);
			if (ret != 0)
				break;
		}
	}

	return ret;
}