path: root/drivers/pwm
diff options
authorArnd Bergmann <arnd@arndb.de>2018-05-25 21:08:30 (GMT)
committerThierry Reding <thierry.reding@gmail.com>2018-06-06 08:15:55 (GMT)
commit414c52b7899aa9097c2fa8444654a866e1df4a0c (patch)
tree63d1784941535495fe0c69d9062513e023ba0b5e /drivers/pwm
parent91348b1453a350da6bb7dda3adf6ea9d662e83b9 (diff)
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: 53e38fe73f94 ("pwm: stm32: Add capture support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index 60bfc07..97bbc1f 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -484,9 +484,7 @@ static int stm32_pwm_apply_locked(struct pwm_chip *chip, struct pwm_device *pwm,
static const struct pwm_ops stm32pwm_ops = {
.owner = THIS_MODULE,
.apply = stm32_pwm_apply_locked,
- .capture = stm32_pwm_capture,
+ .capture = IS_ENABLED(CONFIG_DMA_ENGINE) ? stm32_pwm_capture : NULL,
static int stm32_pwm_set_breakinput(struct stm32_pwm *priv,

Privacy Policy