Skip to content

Commit 9e4f358

Browse files
dianderssuperna9999
authored andcommitted
drm/bridge: ti-sn65dsi86: Don't compile GPIO bits if not CONFIG_OF_GPIO
The kernel test robot noted that if "OF" is defined (which is needed to select DRM_TI_SN65DSI86 at all) but not OF_GPIO that we'd get compile failures because some of the members that we access in "struct gpio_chip" are only defined "#if defined(CONFIG_OF_GPIO)". All the GPIO bits in the driver are all nicely separated out. We'll guard them with the same "#if defined" that the header has and add a little stub function if OF_GPIO is not defined. Fixes: 27ed2b3 ("drm/bridge: ti-sn65dsi86: Export bridge GPIOs to Linux") Reported-by: kernel test robot <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20200612123003.v2.1.Ibe95d8f3daef01e5c57d4c8c398f04d6a839492c@changeid
1 parent e63adec commit 9e4f358

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ struct ti_sn_bridge {
151151
u8 ln_assign;
152152
u8 ln_polrs;
153153

154+
#if defined(CONFIG_OF_GPIO)
154155
struct gpio_chip gchip;
155156
DECLARE_BITMAP(gchip_output, SN_NUM_GPIOS);
157+
#endif
156158
};
157159

158160
static const struct regmap_range ti_sn_bridge_volatile_ranges[] = {
@@ -925,6 +927,8 @@ static int ti_sn_bridge_parse_dsi_host(struct ti_sn_bridge *pdata)
925927
return 0;
926928
}
927929

930+
#if defined(CONFIG_OF_GPIO)
931+
928932
static int tn_sn_bridge_of_xlate(struct gpio_chip *chip,
929933
const struct of_phandle_args *gpiospec,
930934
u32 *flags)
@@ -1092,6 +1096,15 @@ static int ti_sn_setup_gpio_controller(struct ti_sn_bridge *pdata)
10921096
return ret;
10931097
}
10941098

1099+
#else
1100+
1101+
static inline int ti_sn_setup_gpio_controller(struct ti_sn_bridge *pdata)
1102+
{
1103+
return 0;
1104+
}
1105+
1106+
#endif
1107+
10951108
static void ti_sn_bridge_parse_lanes(struct ti_sn_bridge *pdata,
10961109
struct device_node *np)
10971110
{

0 commit comments

Comments
 (0)