Re: [PATCH v2] pwm: mc33xs2410: add support for temperature sensors
From: Dimitri Fedrau
Date: Mon May 19 2025 - 10:12:37 EST
Am Mon, May 19, 2025 at 03:47:26PM +0200 schrieb Uwe Kleine-König:
> Hello Dimitri,
>
> On Mon, May 19, 2025 at 02:40:28PM +0200, Dimitri Fedrau wrote:
> > Perfering IS_REACHABLE over IS_ENABLED is fine for me. Is there a reason
> > why you just didn't replace IS_ENABLED with IS_REACHABLE ?
>
> Because if (IS_REACHABLE(...)) is nicer than #if IS_REACHABLE(...). It
> has better compile coverage and is easier to parse for a human.
>
Sorry, my question was not precise. Diff below is about the replacement
of IS_ENABLED.
diff --git a/drivers/pwm/pwm-mc33xs2410.c b/drivers/pwm/pwm-mc33xs2410.c
index c1b99b114314..b17912ffab19 100644
--- a/drivers/pwm/pwm-mc33xs2410.c
+++ b/drivers/pwm/pwm-mc33xs2410.c
@@ -163,7 +163,7 @@ static int mc33xs2410_modify_reg(struct spi_device *spi, u8 reg, u8 mask, u8 val
return mc33xs2410_write_reg(spi, reg, tmp);
}
-#if IS_ENABLED(CONFIG_HWMON)
+#if IS_REACHABLE(CONFIG_HWMON)
static const struct hwmon_channel_info * const mc33xs2410_hwmon_info[] = {
HWMON_CHANNEL_INFO(temp,
HWMON_T_LABEL | HWMON_T_INPUT,
Best regards,
Dimitri Fedrau