]> git.baikalelectronics.ru Git - kernel.git/commit
clk: introduce clk_is_match
authorMichael Turquette <mturquette@linaro.org>
Wed, 25 Feb 2015 17:11:01 +0000 (09:11 -0800)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 11 Mar 2015 22:56:59 +0000 (15:56 -0700)
commit6ce304ff4b1cc46bfff1bb99bbd5dd496d90da7c
treea3255b002f17851376204e909f3e69b5a3c6fc0c
parentd63d67357a47702e527e16ff41bcf34979d5222f
clk: introduce clk_is_match

Some drivers compare struct clk pointers as a means of knowing
if the two pointers reference the same clock hardware. This behavior is
dubious (drivers must not dereference struct clk), but did not cause any
regressions until the per-user struct clk patch was merged. Now the test
for matching clk's will always fail with per-user struct clk's.

clk_is_match is introduced to fix the regression and prevent drivers
from comparing the pointers manually.

Fixes: 087fa58ec153 ("clk: Make clk API return per-user struct clk instances")
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
[arnd@arndb.de: Fix COMMON_CLK=N && HAS_CLK=Y config]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[sboyd@codeaurora.org: const arguments to clk_is_match() and
remove unnecessary ternary operation]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk.c
include/linux/clk.h