* [PATCH v2] drm/pl111: fix warnings without CONFIG_ARM_AMBA
@ 2017-05-24 15:49 Arnd Bergmann
2017-05-31 18:27 ` Eric Anholt
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-05-24 15:49 UTC (permalink / raw)
To: Eric Anholt, David Airlie
Cc: Arnd Bergmann, Linus Walleij, Daniel Vetter, linux-kernel
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>
---
drivers/gpu/drm/pl111/pl111_drv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 97095b1aa961..daa22849aeed 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -179,7 +179,6 @@ static struct drm_driver pl111_drm_driver = {
#endif
};
-#ifdef CONFIG_ARM_AMBA
static int pl111_amba_probe(struct amba_device *amba_dev,
const struct amba_id *id)
{
@@ -252,7 +251,7 @@ static struct amba_id pl111_id_table[] = {
{0, 0},
};
-static struct amba_driver pl111_amba_driver = {
+static struct amba_driver pl111_amba_driver __maybe_unused = {
.drv = {
.name = "drm-clcd-pl111",
},
@@ -261,8 +260,9 @@ static struct amba_driver pl111_amba_driver = {
.id_table = pl111_id_table,
};
+#ifdef CONFIG_ARM_AMBA
module_amba_driver(pl111_amba_driver);
-#endif /* CONFIG_ARM_AMBA */
+#endif
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_AUTHOR("ARM Ltd.");
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] drm/pl111: fix warnings without CONFIG_ARM_AMBA
2017-05-24 15:49 [PATCH v2] drm/pl111: fix warnings without CONFIG_ARM_AMBA Arnd Bergmann
@ 2017-05-31 18:27 ` Eric Anholt
0 siblings, 0 replies; 2+ messages in thread
From: Eric Anholt @ 2017-05-31 18:27 UTC (permalink / raw)
To: Arnd Bergmann, David Airlie
Cc: Arnd Bergmann, Linus Walleij, Daniel Vetter, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 739 bytes --]
Arnd Bergmann <arnd@arndb.de> writes:
> 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 and merged. Thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-31 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24 15:49 [PATCH v2] drm/pl111: fix warnings without CONFIG_ARM_AMBA Arnd Bergmann
2017-05-31 18:27 ` Eric Anholt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).