• Michael Turquette's avatar
    clk: introduce clk_is_match · 3d3801ef
    Michael Turquette authored
    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: 035a61c3 ("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: default avatarMichael Turquette <mturquette@linaro.org>
    [arnd@arndb.de: Fix COMMON_CLK=N && HAS_CLK=Y config]
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    [sboyd@codeaurora.org: const arguments to clk_is_match() and
    remove unnecessary ternary operation]
    Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
    3d3801ef
clk.c 74.8 KB