drm/sun4i: link in front-end code if needed
commit3156b53c2e2fadafa1a16412a8791b38f94b5bdc
authorArnd Bergmann <arnd@arndb.de>
Fri, 6 Jul 2018 14:28:28 +0000 (6 16:28 +0200)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Mon, 9 Jul 2018 07:54:33 +0000 (9 09:54 +0200)
treeea4197a08ccc3cbb39f9026ce5bc56507d4ba892
parent44f9a4b0dc7563669772198e5b226cab58a00167
drm/sun4i: link in front-end code if needed

When the base sun4i DRM driver is built-in but the back-end is
a loadable module, we run into a link error:

drivers/gpu/drm/sun4i/sun4i_drv.o: In function `sun4i_drv_probe':
sun4i_drv.c:(.text+0x60c): undefined reference to `sun4i_frontend_of_table'

The dependency is a bit tricky, the best workaround I have come up
with is to use a Makefile hack to to interpret both
CONFIG_DRM_SUN4I_BACKEND=m and CONFIG_DRM_SUN4I_BACKEND=y
as a directive to build the front-end the same way as the main module.

Fixes: dd0421f47505 ("drm/sun4i: Add a driver for the display frontend")
Link: https://lore.kernel.org/lkml/20180301091908.zcptz3ezqr2c6ly5@flea/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180706142847.2032381-1-arnd@arndb.de
drivers/gpu/drm/sun4i/Makefile