Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d95c9760 authored by Fabrice Gasnier's avatar Fabrice Gasnier Committed by Lee Jones
Browse files

mfd: stm32-timers: Fix pwm-stm32 linker issue with COMPILE_TEST



This is seen when COMPILE_TEST=y and MFD_STM32_TIMERS=n.
drivers/pwm/pwm-stm32.o: In function 'stm32_pwm_raw_capture':
pwm-stm32.c:... undefined reference to 'stm32_timers_dma_burst_read'
Fixes: 0c660980 ("mfd: stm32-timers: Add support for DMAs")

Signed-off-by: default avatarFabrice Gasnier <fabrice.gasnier@st.com>
Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>

Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent a3b51be3
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -124,8 +124,20 @@ struct stm32_timers {
	struct stm32_timers_dma dma; /* Only to be used by the parent */
};

#if IS_REACHABLE(CONFIG_MFD_STM32_TIMERS)
int stm32_timers_dma_burst_read(struct device *dev, u32 *buf,
				enum stm32_timers_dmas id, u32 reg,
				unsigned int num_reg, unsigned int bursts,
				unsigned long tmo_ms);
#else
static inline int stm32_timers_dma_burst_read(struct device *dev, u32 *buf,
					      enum stm32_timers_dmas id,
					      u32 reg,
					      unsigned int num_reg,
					      unsigned int bursts,
					      unsigned long tmo_ms)
{
	return -ENODEV;
}
#endif
#endif