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

Commit e4bf5bec authored by viresh kumar's avatar viresh kumar Committed by Russell King
Browse files

ARM: 5979/1: CLKDEV: return from clk_find as soon as we get maching clk



clk_find function looks for clock with matching dev_id and con_id.
We should return from clk_find as soon as we get a clock with matching
dev_id and con_id. This can be done by comparing variable "match" with 3.

Acked-by: default avatarUwe Kleine-Konig <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 0deac0bf
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -52,12 +52,13 @@ static struct clk *clk_find(const char *dev_id, const char *con_id)
				continue;
				continue;
			match += 1;
			match += 1;
		}
		}
		if (match == 0)
			continue;


		if (match > best) {
		if (match > best) {
			clk = p->clk;
			clk = p->clk;
			if (match != 3)
				best = match;
				best = match;
			else
				break;
		}
		}
	}
	}
	return clk;
	return clk;