Skip to content

Commit 414c52b

Browse files
arndbthierryreding
authored andcommitted
pwm: stm32: Fix build warning with CONFIG_DMA_ENGINE disabled
Without dmaengine support, we get a harmless warning about an unused function: drivers/pwm/pwm-stm32.c:166:12: error: 'stm32_pwm_capture' defined but not used [-Werror=unused-function] Changing the #ifdef to an IS_ENABLED() check shuts up that warning and is slightly nicer to read. Fixes: 53e38fe ("pwm: stm32: Add capture support") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Fabrice Gasnier <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 91348b1 commit 414c52b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/pwm/pwm-stm32.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,7 @@ static int stm32_pwm_apply_locked(struct pwm_chip *chip, struct pwm_device *pwm,
484484
static const struct pwm_ops stm32pwm_ops = {
485485
.owner = THIS_MODULE,
486486
.apply = stm32_pwm_apply_locked,
487-
#if IS_ENABLED(CONFIG_DMA_ENGINE)
488-
.capture = stm32_pwm_capture,
489-
#endif
487+
.capture = IS_ENABLED(CONFIG_DMA_ENGINE) ? stm32_pwm_capture : NULL,
490488
};
491489

492490
static int stm32_pwm_set_breakinput(struct stm32_pwm *priv,

0 commit comments

Comments
 (0)