Re: [PATCH] clk.h: Fix shim ifdef guard (HAVE_CLK -> COMMON_CLK)

From: Russell King
Date: Mon Aug 27 2012 - 14:52:59 EST


On Mon, Aug 27, 2012 at 11:28:15AM -0400, Jeff Mahoney wrote:
> Commit 93abe8e4 (clk: add non HAVE_CLK routines) added shims for
> the clk code but HAVE_CLK isn't enough. It's possible to have the
> clk support but not enable it. We end up with full prototypes for code
> that is never built - causing module linking to fail later.
>
> This patch changes the guard to use COMMON_CLK, which actually guards
> the code.

This is wrong. COMMON_CLK is an _implementation_ of the CLK API. It
is not the only implementation in the kernel. Conditionalizing like
this breaks existing users.

HAVE_CLK is the right thing here - if you define HAVE_CLK then you _are_
providing an implementation of clk_get() et.al. If you're not, then you
do not define HAVE_CLK. Simples.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/