diff mbox

[v5,00/14] ARM: samsung-time: Prepare for multiplatform support

Message ID 201304130022.49987.heiko@sntech.de (mailing list archive)
State New, archived
Headers show

Commit Message

Heiko Stuebner April 12, 2013, 10:22 p.m. UTC
Hi Tomasz,

Am Freitag, 12. April 2013, 21:17:16 schrieb Tomasz Figa:
> This series is an attempt to make the samsung-time clocksource driver ready
> for multiplatform kernels. It moves the driver to drivers/clocksource,
> cleans it up from uses of static platform-specific definitions, simplifies
> timer interrupt handling and adds Device Tree support.
> 
> The samsung_pwm clocksource driver is made the master driver, which
> exposes a single function to the PWM driver to get required data. Only
> samsung-time driver is reworked to use the master driver at this time,
> since the PWM driver can be already considered broken at the moment and
> needs separate series of several patches to fix and clean it up, which
> I am already working on.
> 
> Tested on Universal C210 board with Device Tree. Not tested without
> Device Tree, since it has been already broken before this series.
> Compile tested for other related SoCs.

On a s3c2416 based board with both non-dt and preliminary-dt support
Tested-by: Heiko Stuebner <heiko@sntech.de>

One nitpick:

Without dt support, you get this:

  CC      drivers/clocksource/samsung_pwm.o
drivers/clocksource/samsung_pwm.c:620: warning: ‘samsung_pwm_clocksource_init_of’ defined but not used

So, something like the following might be necessary

-------------- 8< -------------------
-------------- 8< -------------------


Heiko
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Arnd Bergmann April 12, 2013, 10:26 p.m. UTC | #1
On Saturday 13 April 2013 00:22:48 Heiko Stübner wrote:
> 
> Without dt support, you get this:
> 
>   CC      drivers/clocksource/samsung_pwm.o
> drivers/clocksource/samsung_pwm.c:620: warning: ‘samsung_pwm_clocksource_init_of’ defined but not used
> 
> So, something like the following might be necessary

That patch should not be required any more with the definition

#ifdef CONFIG_CLKSRC_OF
extern void clocksource_of_init(void);

#define CLOCKSOURCE_OF_DECLARE(name, compat, fn)                        \
        static const struct of_device_id __clksrc_of_table_##name       \
                __used __section(__clksrc_of_table)                     \
                 = { .compatible = compat,                              \
                     .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn }
#else
static inline void clocksource_of_init(void) {}
#define CLOCKSOURCE_OF_DECLARE(name, compat, fn)                        \
        static const struct of_device_id __clksrc_of_table_##name       \
                __attribute__((unused))                                 \
                 = { .compatible = compat,                              \
                     .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn }
#endif

which turns the ‘samsung_pwm_clocksource_init_of’ function into an unused
symbol that gets silently dropped by gcc, at least in theory. Are you
using the latest clksrc/cleanup branch as a base?

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Heiko Stuebner April 12, 2013, 10:39 p.m. UTC | #2
Am Samstag, 13. April 2013, 00:26:43 schrieb Arnd Bergmann:
> On Saturday 13 April 2013 00:22:48 Heiko Stübner wrote:
> > Without dt support, you get this:
> >   CC      drivers/clocksource/samsung_pwm.o
> > 
> > drivers/clocksource/samsung_pwm.c:620: warning:
> > ‘samsung_pwm_clocksource_init_of’ defined but not used
> > 
> > So, something like the following might be necessary
> 
> That patch should not be required any more with the definition
> 
> #ifdef CONFIG_CLKSRC_OF
> extern void clocksource_of_init(void);
> 
> #define CLOCKSOURCE_OF_DECLARE(name, compat, fn)                        \
>         static const struct of_device_id __clksrc_of_table_##name       \
>                 __used __section(__clksrc_of_table)                     \
>                  = { .compatible = compat,                              \
>                      .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn
> } #else
> static inline void clocksource_of_init(void) {}
> #define CLOCKSOURCE_OF_DECLARE(name, compat, fn)                        \
>         static const struct of_device_id __clksrc_of_table_##name       \
>                 __attribute__((unused))                                 \
>                  = { .compatible = compat,                              \
>                      .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn
> } #endif
> 
> which turns the ‘samsung_pwm_clocksource_init_of’ function into an unused
> symbol that gets silently dropped by gcc, at least in theory. Are you
> using the latest clksrc/cleanup branch as a base?

Nope, I just put the stuff on top of all the other changes. So it seems 
everything is fine and working ... very nice :-)


Heiko
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomasz Figa April 12, 2013, 10:42 p.m. UTC | #3
On Saturday 13 of April 2013 00:39:24 Heiko Stübner wrote:
> Am Samstag, 13. April 2013, 00:26:43 schrieb Arnd Bergmann:
> > On Saturday 13 April 2013 00:22:48 Heiko Stübner wrote:
> > > Without dt support, you get this:
> > >   CC      drivers/clocksource/samsung_pwm.o
> > > 
> > > drivers/clocksource/samsung_pwm.c:620: warning:
> > > ‘samsung_pwm_clocksource_init_of’ defined but not used
> > > 
> > > So, something like the following might be necessary
> > 
> > That patch should not be required any more with the definition
> > 
> > #ifdef CONFIG_CLKSRC_OF
> > extern void clocksource_of_init(void);
> > 
> > #define CLOCKSOURCE_OF_DECLARE(name, compat, fn)                      
> >  \> 
> >         static const struct of_device_id __clksrc_of_table_##name     
> >          \
> >         
> >                 __used __section(__clksrc_of_table)                   
> >                  \
> >                 
> >                  = { .compatible = compat,                            
> >                   \
> >                  
> >                      .data = (fn == (clocksource_of_init_fn)NULL) ? fn
> >                      : fn
> > 
> > } #else
> > static inline void clocksource_of_init(void) {}
> > #define CLOCKSOURCE_OF_DECLARE(name, compat, fn)                      
> >  \> 
> >         static const struct of_device_id __clksrc_of_table_##name     
> >          \
> >         
> >                 __attribute__((unused))                               
> >                  \
> >                 
> >                  = { .compatible = compat,                            
> >                   \
> >                  
> >                      .data = (fn == (clocksource_of_init_fn)NULL) ? fn
> >                      : fn
> > 
> > } #endif
> > 
> > which turns the ‘samsung_pwm_clocksource_init_of’ function into an
> > unused symbol that gets silently dropped by gcc, at least in theory.
> > Are you using the latest clksrc/cleanup branch as a base?
> 
> Nope, I just put the stuff on top of all the other changes. So it seems
> everything is fine and working ... very nice :-)

Great. Thanks for testing.

I will try to rebase my patches for s3c64xx on top of this and do some 
testing as well.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/clocksource/samsung_pwm.c b/drivers/clocksource/samsung_pwm.c
index a12ee08..2bf8303 100644
--- a/drivers/clocksource/samsung_pwm.c
+++ b/drivers/clocksource/samsung_pwm.c
@@ -617,6 +617,7 @@  static void __init __samsung_pwm_clocksource_init(
        samsung_clocksource_init();
 }
 
+#ifdef CONFIG_CLKSRC_OF
 static void __init samsung_pwm_clocksource_init_of(struct device_node *np)
 {
        __samsung_pwm_clocksource_init(NULL, np);
@@ -629,6 +630,7 @@  CLOCKSOURCE_OF_DECLARE(s5p6440_pwm, "samsung,s5p6440-pwm",
                                        samsung_pwm_clocksource_init_of);
 CLOCKSOURCE_OF_DECLARE(s5pc100_pwm, "samsung,s5pc100-pwm",
                                        samsung_pwm_clocksource_init_of);
+#endif
 
 void __init samsung_pwm_clocksource_init(struct platform_device *pdev)
 {