From f9f9f11dcf0f3b757b282ce7cefea8696212a422 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 12 Oct 2015 14:43:22 +0200 Subject: of/irq: move of_msi_configure to the right guard and add a dummy of_msi_configure is part of of_irq.c, which is compiled in when OF_IRQ is enabled, not just OF. Also It is unconditionally called from of_platform_device_create_pdata, which does not depend on OF_IRQ, just OF_ADDRESS, so we need a dummy implementation in case of OF_ADDRESS=y but OF_IRQ=n. Fixes: c706c239 ("of/platform: Assign MSI domain to platform device") Signed-off-by: Jonas Gorski Signed-off-by: Rob Herring --- include/linux/of_irq.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/linux/of_irq.h') diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 4bcbd586a672..0088038d5ccd 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -46,6 +46,7 @@ extern int of_irq_get(struct device_node *dev, int index); extern int of_irq_get_byname(struct device_node *dev, const char *name); extern int of_irq_to_resource_table(struct device_node *dev, struct resource *res, int nr_irqs); +extern void of_msi_configure(struct device *dev, struct device_node *np); #else static inline int of_irq_count(struct device_node *dev) { @@ -64,6 +65,9 @@ static inline int of_irq_to_resource_table(struct device_node *dev, { return 0; } +static inline void of_msi_configure(struct device *dev, struct device_node *np) +{ +} #endif #if defined(CONFIG_OF) @@ -74,7 +78,6 @@ static inline int of_irq_to_resource_table(struct device_node *dev, */ extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); extern struct device_node *of_irq_find_parent(struct device_node *child); -extern void of_msi_configure(struct device *dev, struct device_node *np); #else /* !CONFIG_OF */ static inline unsigned int irq_of_parse_and_map(struct device_node *dev, -- cgit From 52493d446141b07c8ba28dd6a529513f8b2342bd Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 12 Oct 2015 14:43:23 +0200 Subject: of/irq: make of_irq_find_parent static of_irq_find_parent has no users outside of of_irq.c, so it does not make sense to expose it in of_irq.h. Therefore remove the prototype and dummy implmeentation and make the function static instead. Signed-off-by: Jonas Gorski Signed-off-by: Rob Herring --- include/linux/of_irq.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include/linux/of_irq.h') diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 0088038d5ccd..a58e2e51eeb2 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -77,7 +77,6 @@ static inline void of_msi_configure(struct device *dev, struct device_node *np) * so declare it here regardless of the CONFIG_OF_IRQ setting. */ extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); -extern struct device_node *of_irq_find_parent(struct device_node *child); #else /* !CONFIG_OF */ static inline unsigned int irq_of_parse_and_map(struct device_node *dev, @@ -85,11 +84,6 @@ static inline unsigned int irq_of_parse_and_map(struct device_node *dev, { return 0; } - -static inline void *of_irq_find_parent(struct device_node *child) -{ - return NULL; -} #endif /* !CONFIG_OF */ #endif /* __OF_IRQ_H */ -- cgit From 62ebf931935964230d6fe39026bc5fbcfac330d3 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 12 Oct 2015 14:43:24 +0200 Subject: of/irq: fix guards for irq_of_parse_and_map prototype Since OF is now a userselectable config symbol, having OF=y but OF_IRQ=n is a valid combination for non-OF platforms, and OF=y does not guarantee anymore that OF_IRQ is enabled (or we are building for SPARC). Fixes the following build error with OF=y, IRQ_DOMAIN=n and SPI=y: drivers/built-in.o: In function `spi_register_master': (.text+0xc3ae): undefined reference to `irq_of_parse_and_map' Makefile:935: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 Signed-off-by: Jonas Gorski Signed-off-by: Rob Herring --- include/linux/of_irq.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/of_irq.h') diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index a58e2e51eeb2..580818d90475 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -70,7 +70,7 @@ static inline void of_msi_configure(struct device *dev, struct device_node *np) } #endif -#if defined(CONFIG_OF) +#if defined(CONFIG_OF_IRQ) || defined(CONFIG_SPARC) /* * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC * implements it differently. However, the prototype is the same for all, @@ -78,7 +78,7 @@ static inline void of_msi_configure(struct device *dev, struct device_node *np) */ extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); -#else /* !CONFIG_OF */ +#else /* !CONFIG_OF && !CONFIG_SPARC */ static inline unsigned int irq_of_parse_and_map(struct device_node *dev, int index) { -- cgit