mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rtc: hym8563: include clkout code only if COMMON_CLK active
@ 2013-12-17 15:11 Heiko Stübner
  2013-12-17 22:28 ` Stephen Rothwell
  0 siblings, 1 reply; 2+ messages in thread
From: Heiko Stübner @ 2013-12-17 15:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Stephen Rothwell, linux-kernel, rtc-linux

The contents of clk-provide.h, struct clk_hw etc, are only available
if CONFIG_COMMON_CLK is selected. Therefore IS_ENABLED(COMMON_CLK) is
not sufficient and real preprocessor conditions are necessary to
keep the code in question from being compiled on non-COMMON_CLK systems.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/rtc/rtc-hym8563.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 841392c..b56e3d3 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -87,7 +87,9 @@ struct hym8563 {
 	struct i2c_client	*client;
 	struct rtc_device	*rtc;
 	bool			valid;
+#ifdef CONFIG_COMMON_CLK
 	struct clk_hw		clkout_hw;
+#endif
 };
 
 /*
@@ -290,6 +292,7 @@ static const struct rtc_class_ops hym8563_rtc_ops = {
  * Handling of the clkout
  */
 
+#ifdef CONFIG_COMMON_CLK
 #define clkout_hw_to_hym8563(_hw) container_of(_hw, struct hym8563, clkout_hw)
 
 static int clkout_rates[] = {
@@ -423,6 +426,7 @@ static struct clk *hym8563_clkout_register_clk(struct hym8563 *hym8563)
 
 	return clk;
 }
+#endif
 
 /*
  * The alarm interrupt is implemented as a level-low interrupt in the
@@ -565,8 +569,9 @@ static int hym8563_probe(struct i2c_client *client,
 	if (IS_ERR(hym8563->rtc))
 		return PTR_ERR(hym8563->rtc);
 
-	if (IS_ENABLED(CONFIG_COMMON_CLK))
-		hym8563_clkout_register_clk(hym8563);
+#ifdef CONFIG_COMMON_CLK
+	hym8563_clkout_register_clk(hym8563);
+#endif
 
 	return 0;
 }
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: hym8563: include clkout code only if COMMON_CLK active
  2013-12-17 15:11 [PATCH] rtc: hym8563: include clkout code only if COMMON_CLK active Heiko Stübner
@ 2013-12-17 22:28 ` Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2013-12-17 22:28 UTC (permalink / raw)
  To: Heiko Stübner; +Cc: Andrew Morton, linux-kernel, rtc-linux

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

Hi Heiko,

On Tue, 17 Dec 2013 16:11:30 +0100 Heiko Stübner <heiko@sntech.de> wrote:
>
> The contents of clk-provide.h, struct clk_hw etc, are only available
> if CONFIG_COMMON_CLK is selected. Therefore IS_ENABLED(COMMON_CLK) is
> not sufficient and real preprocessor conditions are necessary to
> keep the code in question from being compiled on non-COMMON_CLK systems.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>

I will add this to the akpm-current merge today (unless Andrew beats me to it).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-17 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-17 15:11 [PATCH] rtc: hym8563: include clkout code only if COMMON_CLK active Heiko Stübner
2013-12-17 22:28 ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®