diff mbox series

pwm: stm32: enforce dependency on CONFIG_MFD_STM32_TIMERS

Message ID 20180525160523.29124-1-arnd@arndb.de
State Accepted
Headers show
Series pwm: stm32: enforce dependency on CONFIG_MFD_STM32_TIMERS | expand

Commit Message

Arnd Bergmann May 25, 2018, 4:04 p.m. UTC
When compile-testing the pwm driver without also enabling the
stm32_timers MFD, we run into a link error:

drivers/pwm/pwm-stm32.o: In function `stm32_pwm_raw_capture.isra.6':
pwm-stm32.c:(.text+0xcb0): undefined reference to `stm32_timers_dma_burst_read'

We don't need the '|| COMPILE_TEST' here, since stm32_timers itself
can be built with CONFIG_COMPILE_TEST on all architectures, so we do
get the coverage through allmodconfig and randconfig builds even
when we make it a hard dependency.

Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/pwm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thierry Reding June 6, 2018, 8:04 a.m. UTC | #1
On Fri, May 25, 2018 at 06:04:54PM +0200, Arnd Bergmann wrote:
> When compile-testing the pwm driver without also enabling the
> stm32_timers MFD, we run into a link error:
> 
> drivers/pwm/pwm-stm32.o: In function `stm32_pwm_raw_capture.isra.6':
> pwm-stm32.c:(.text+0xcb0): undefined reference to `stm32_timers_dma_burst_read'
> 
> We don't need the '|| COMPILE_TEST' here, since stm32_timers itself
> can be built with CONFIG_COMPILE_TEST on all architectures, so we do
> get the coverage through allmodconfig and randconfig builds even
> when we make it a hard dependency.
> 
> Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/pwm/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thierry
Thierry Reding June 6, 2018, 8:13 a.m. UTC | #2
On Fri, May 25, 2018 at 06:04:54PM +0200, Arnd Bergmann wrote:
> When compile-testing the pwm driver without also enabling the
> stm32_timers MFD, we run into a link error:
> 
> drivers/pwm/pwm-stm32.o: In function `stm32_pwm_raw_capture.isra.6':
> pwm-stm32.c:(.text+0xcb0): undefined reference to `stm32_timers_dma_burst_read'
> 
> We don't need the '|| COMPILE_TEST' here, since stm32_timers itself
> can be built with CONFIG_COMPILE_TEST on all architectures, so we do
> get the coverage through allmodconfig and randconfig builds even
> when we make it a hard dependency.
> 
> Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/pwm/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I think Lee already picked up a patch by Fabrice that fixes this by
adding a dummy implementation, see:

	http://patchwork.ozlabs.org/patch/916435/

I prefer your solution, though, because the dummy is pretty redundant if
we can just make this a hard-dependency and still get the same coverage.

Thierry
Lee Jones June 7, 2018, 5:08 a.m. UTC | #3
On Wed, 06 Jun 2018, Thierry Reding wrote:

> On Fri, May 25, 2018 at 06:04:54PM +0200, Arnd Bergmann wrote:
> > When compile-testing the pwm driver without also enabling the
> > stm32_timers MFD, we run into a link error:
> > 
> > drivers/pwm/pwm-stm32.o: In function `stm32_pwm_raw_capture.isra.6':
> > pwm-stm32.c:(.text+0xcb0): undefined reference to `stm32_timers_dma_burst_read'
> > 
> > We don't need the '|| COMPILE_TEST' here, since stm32_timers itself
> > can be built with CONFIG_COMPILE_TEST on all architectures, so we do
> > get the coverage through allmodconfig and randconfig builds even
> > when we make it a hard dependency.
> > 
> > Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/pwm/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I think Lee already picked up a patch by Fabrice that fixes this by
> adding a dummy implementation, see:
> 
> 	http://patchwork.ozlabs.org/patch/916435/
> 
> I prefer your solution, though, because the dummy is pretty redundant if
> we can just make this a hard-dependency and still get the same coverage.

The two patches aren't mutually exclusive. :)
diff mbox series

Patch

diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 4635cb35008c..a4d262db9945 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -401,7 +401,7 @@  config PWM_STI
 
 config PWM_STM32
 	tristate "STMicroelectronics STM32 PWM"
-	depends on MFD_STM32_TIMERS || COMPILE_TEST
+	depends on MFD_STM32_TIMERS
 	help
 	  Generic PWM framework driver for STM32 SoCs.