Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Uwe Kleine-König and committed by
Uwe Kleine-König
4b31eb55 058210e8

+2 -2
+2 -2
include/linux/pwm.h
··· 379 379 dev_set_drvdata(&chip->dev, data); 380 380 } 381 381 382 - #if IS_ENABLED(CONFIG_PWM) 382 + #if IS_REACHABLE(CONFIG_PWM) 383 383 384 384 /* PWM consumer APIs */ 385 385 int pwm_round_waveform_might_sleep(struct pwm_device *pwm, struct pwm_waveform *wf); ··· 661 661 PWM_LOOKUP_WITH_MODULE(_provider, _index, _dev_id, _con_id, _period, \ 662 662 _polarity, NULL) 663 663 664 - #if IS_ENABLED(CONFIG_PWM) 664 + #if IS_REACHABLE(CONFIG_PWM) 665 665 void pwm_add_table(struct pwm_lookup *table, size_t num); 666 666 void pwm_remove_table(struct pwm_lookup *table, size_t num); 667 667 #else