[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1479052766-1525-1-git-send-email-contact@stefanchrist.eu>
Date: Sun, 13 Nov 2016 16:59:26 +0100
From: Stefan Christ <contact@...fanchrist.eu>
To: alexander.deucher@....com, christian.koenig@....com,
marc.zyngier@....com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] irqdomain: fix compiling when IRQ_DOMAIN unset
When config option IRQ_DOMAIN is unset, compiling the file
'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c' fails:
CC drivers/gpu/drm/amd/amdgpu/amdgpu_irq.o
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_dispatch’:
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:345:3: error: implicit declaration of
function ‘irq_find_mapping’ [-Werror=implicit-function-declaration]
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_add_domain’:
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:529:2: error: implicit declaration of
function ‘irq_domain_add_linear’ [-Werror=implicit-function-declaration]
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_remove_domain’:
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:550:3: error: implicit declaration of
function ‘irq_domain_remove’ [-Werror=implicit-function-declaration]
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_create_mapping’:
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:569:2: error: implicit declaration of
function ‘irq_create_mapping’ [-Werror=implicit-function-declaration]
Adding the functions stubs in the header file so it compiles cleanly.
Maybe the drm driver 'amdgpu' should select the config option IRQ_DOMAIN
if it cannot work without it. But I don't know if that's necessary.
Signed-off-by: Stefan Christ <contact@...fanchrist.eu>
---
include/linux/irqdomain.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index ffb8460..1c79a0d 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -480,6 +480,24 @@ static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
#endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
#else /* CONFIG_IRQ_DOMAIN */
+static inline int irq_find_mapping(struct irq_domain *host,
+ irq_hw_number_t hwirq)
+{
+ return 0;
+}
+static inline struct irq_domain *irq_domain_add_linear(
+ struct device_node *of_node, unsigned int size,
+ const struct irq_domain_ops *ops,
+ void *host_data)
+{
+ return NULL;
+}
+static inline void irq_domain_remove(struct irq_domain *host) { }
+static inline unsigned int irq_create_mapping(struct irq_domain *host,
+ irq_hw_number_t hwirq)
+{
+ return 0;
+}
static inline void irq_dispose_mapping(unsigned int virq) { }
static inline void irq_domain_activate_irq(struct irq_data *data) { }
static inline void irq_domain_deactivate_irq(struct irq_data *data) { }
--
2.7.3
Powered by blists - more mailing lists