[PATCH] drm/modes: add non-OF stub for of_get_drm_display_mode
Daniel Vetter
daniel at ffwll.ch
Fri Jan 8 14:45:05 UTC 2021
On Fri, Jan 08, 2021 at 11:13:43AM +0100, Philipp Zabel wrote:
> If CONFIG_OF is disabled, of_get_drm_display_mode is not compiled in,
> and drivers using it fail to build:
>
> ld: drivers/gpu/drm/imx/parallel-display.o: in function `imx_pd_connector_get_modes':
> parallel-display.c:(.text+0x8d): undefined reference to `of_get_drm_display_mode'
>
> Add an inline stub so they can be build-tested with non-OF
> configurations.
>
> Reported-by: Randy Dunlap <rdunlap at infradead.org>
> Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
Makes sense, we have dummy functions for !CONFIG_OF for all the others
already.
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
Cheers, Daniel
> ---
> include/drm/drm_modes.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index a0d79d1c51e2..29ba4adf0c53 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -461,9 +461,19 @@ void drm_display_mode_from_videomode(const struct videomode *vm,
> void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
> struct videomode *vm);
> void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags);
> +
> +#if defined(CONFIG_OF)
> int of_get_drm_display_mode(struct device_node *np,
> struct drm_display_mode *dmode, u32 *bus_flags,
> int index);
> +#else
> +static inline int of_get_drm_display_mode(struct device_node *np,
> + struct drm_display_mode *dmode,
> + u32 *bus_flags, int index)
> +{
> + return -EINVAL;
> +}
> +#endif
>
> void drm_mode_set_name(struct drm_display_mode *mode);
> int drm_mode_vrefresh(const struct drm_display_mode *mode);
> --
> 2.20.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list