Skip to content

Commit 3101b1e

Browse files
Uwe Kleine-KönigBartosz Golaszewski
authored andcommitted
gpio: mvebu: Use IS_REACHABLE instead of IS_ENABLED for CONFIG_PWM
To check if a certain function (here e.g. pwmchip_add()) can be called IS_REACHABLE is the better check. The relevant difference to IS_ENABLED is that IS_REACHABLE evaluates to 0 if the current code is builtin but the checked symbol is =m and so must not be used. Today there is no practical impact as CONFIG_PWM is a bool. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent fd648e1 commit 3101b1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio-mvebu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ static int mvebu_gpio_suspend(struct platform_device *pdev, pm_message_t state)
10021002
BUG();
10031003
}
10041004

1005-
if (IS_ENABLED(CONFIG_PWM))
1005+
if (IS_REACHABLE(CONFIG_PWM))
10061006
mvebu_pwm_suspend(mvchip);
10071007

10081008
return 0;
@@ -1054,7 +1054,7 @@ static int mvebu_gpio_resume(struct platform_device *pdev)
10541054
BUG();
10551055
}
10561056

1057-
if (IS_ENABLED(CONFIG_PWM))
1057+
if (IS_REACHABLE(CONFIG_PWM))
10581058
mvebu_pwm_resume(mvchip);
10591059

10601060
return 0;
@@ -1228,7 +1228,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
12281228
devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip);
12291229

12301230
/* Some MVEBU SoCs have simple PWM support for GPIO lines */
1231-
if (IS_ENABLED(CONFIG_PWM)) {
1231+
if (IS_REACHABLE(CONFIG_PWM)) {
12321232
err = mvebu_pwm_probe(pdev, mvchip, id);
12331233
if (err)
12341234
return err;

0 commit comments

Comments
 (0)