Skip to content

Commit ed531fe

Browse files
ukleinekdianders
authored andcommitted
drm/bridge: ti-sn65dsi86: Check for CONFIG_PWM using IS_REACHABLE()
Currently CONFIG_PWM is a bool but I intend to change it to tristate. If CONFIG_PWM=m in the configuration, the cpp symbol CONFIG_PWM isn't defined and so the PWM code paths in the ti-sn65dsi86 driver are not used. The correct way to check for CONFIG_PWM is using IS_REACHABLE which does the right thing for all cases CONFIG_DRM_TI_SN65DSI86 ∈ { y, m } x CONFIG_PWM ∈ { y, m, n }. There is no change until CONFIG_PWM actually becomes tristate. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Louis Chauvet <[email protected]> Reviewed-by: Robert Foss <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 27d4815 commit ed531fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/bridge/ti-sn65dsi86.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ struct ti_sn65dsi86 {
195195
struct gpio_chip gchip;
196196
DECLARE_BITMAP(gchip_output, SN_NUM_GPIOS);
197197
#endif
198-
#if defined(CONFIG_PWM)
198+
#if IS_REACHABLE(CONFIG_PWM)
199199
struct pwm_chip *pchip;
200200
bool pwm_enabled;
201201
atomic_t pwm_pin_busy;
@@ -1362,7 +1362,7 @@ static struct auxiliary_driver ti_sn_bridge_driver = {
13621362
/* -----------------------------------------------------------------------------
13631363
* PWM Controller
13641364
*/
1365-
#if defined(CONFIG_PWM)
1365+
#if IS_REACHABLE(CONFIG_PWM)
13661366
static int ti_sn_pwm_pin_request(struct ti_sn65dsi86 *pdata)
13671367
{
13681368
return atomic_xchg(&pdata->pwm_pin_busy, 1) ? -EBUSY : 0;
@@ -1956,7 +1956,7 @@ static int ti_sn65dsi86_probe(struct i2c_client *client)
19561956
return ret;
19571957
}
19581958

1959-
if (IS_ENABLED(CONFIG_PWM)) {
1959+
if (IS_REACHABLE(CONFIG_PWM)) {
19601960
ret = ti_sn65dsi86_add_aux_device(pdata, &pdata->pwm_aux, "pwm");
19611961
if (ret)
19621962
return ret;

0 commit comments

Comments
 (0)