Skip to content

Commit 4b31eb5

Browse files
ukleinekUwe Kleine-König
authored andcommitted
pwm: Check for CONFIG_PWM using IS_REACHABLE() in main header
Preparing CONFIG_PWM becoming tristate the right magic to check for the availability of the pwm functions is using IS_REACHABLE() and not IS_ENABLED(). The latter gives the wrong result for built-in code with CONFIG_PWM=m. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/20250217102504.687916-2-u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
1 parent 058210e commit 4b31eb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/pwm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static inline void pwmchip_set_drvdata(struct pwm_chip *chip, void *data)
379379
dev_set_drvdata(&chip->dev, data);
380380
}
381381

382-
#if IS_ENABLED(CONFIG_PWM)
382+
#if IS_REACHABLE(CONFIG_PWM)
383383

384384
/* PWM consumer APIs */
385385
int pwm_round_waveform_might_sleep(struct pwm_device *pwm, struct pwm_waveform *wf);
@@ -661,7 +661,7 @@ struct pwm_lookup {
661661
PWM_LOOKUP_WITH_MODULE(_provider, _index, _dev_id, _con_id, _period, \
662662
_polarity, NULL)
663663

664-
#if IS_ENABLED(CONFIG_PWM)
664+
#if IS_REACHABLE(CONFIG_PWM)
665665
void pwm_add_table(struct pwm_lookup *table, size_t num);
666666
void pwm_remove_table(struct pwm_lookup *table, size_t num);
667667
#else

0 commit comments

Comments
 (0)