X-Git-Url: https://repo.jachan.dev/linux.git/blobdiff_plain/e3691b7143c8804bc345bcbbdda9d13de9d1dd80..57e94c8b974d:/drivers/pwm/pwm-stm32.c diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 60bfc07c4912..4f842550fbd1 100644 --- a/drivers/pwm/pwm-stm32.c +++ b/drivers/pwm/pwm-stm32.c @@ -170,7 +170,7 @@ static int stm32_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm, unsigned long long prd, div, dty; unsigned long rate; unsigned int psc = 0, icpsc, scale; - u32 raw_prd, raw_dty; + u32 raw_prd = 0, raw_dty = 0; int ret = 0; mutex_lock(&priv->lock); @@ -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, -#if IS_ENABLED(CONFIG_DMA_ENGINE) - .capture = stm32_pwm_capture, -#endif + .capture = IS_ENABLED(CONFIG_DMA_ENGINE) ? stm32_pwm_capture : NULL, }; static int stm32_pwm_set_breakinput(struct stm32_pwm *priv,