Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/pl111: fix warnings without CONFIG_ARM_AMBA

The driver is written in a way to enable compile-testing without CONFIG_ARM_AMBA,
but it just causes needless warnings:

drivers/gpu/drm/pl111/pl111_drv.c:149:26: error: 'pl111_drm_driver' defined but not used [-Werror=unused-variable]
drivers/gpu/drm/pl111/pl111_drv.c:81:12: error: 'pl111_modeset_init' defined but not used [-Werror=unused-function]

This unhides the probe/remove functions again and just leaves the driver
object as unused when CONFIG_ARM_AMBA is disabled, with a __maybe_unused
annotation to shut up the warning.

Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170524155020.1777369-1-arnd@arndb.de

authored by

Arnd Bergmann and committed by
Eric Anholt
66d6dd45 91110a4b

+3 -3
+3 -3
drivers/gpu/drm/pl111/pl111_drv.c
··· 179 179 #endif 180 180 }; 181 181 182 - #ifdef CONFIG_ARM_AMBA 183 182 static int pl111_amba_probe(struct amba_device *amba_dev, 184 183 const struct amba_id *id) 185 184 { ··· 251 252 {0, 0}, 252 253 }; 253 254 254 - static struct amba_driver pl111_amba_driver = { 255 + static struct amba_driver pl111_amba_driver __maybe_unused = { 255 256 .drv = { 256 257 .name = "drm-clcd-pl111", 257 258 }, ··· 260 261 .id_table = pl111_id_table, 261 262 }; 262 263 264 + #ifdef CONFIG_ARM_AMBA 263 265 module_amba_driver(pl111_amba_driver); 264 - #endif /* CONFIG_ARM_AMBA */ 266 + #endif 265 267 266 268 MODULE_DESCRIPTION(DRIVER_DESC); 267 269 MODULE_AUTHOR("ARM Ltd.");