Skip to content

Commit c58d900

Browse files
arndbKalle Valo
authored andcommitted
bcma: fix building without OF_IRQ
The bcma driver core can be built with or without DT support, but it fails to build when CONFIG_OF=y and CONFIG_OF_IRQ=n, which can happen on platforms that do not support IRQ domains. ERROR: "irq_create_of_mapping" [drivers/bcma/bcma.ko] undefined! ERROR: "of_irq_parse_raw" [drivers/bcma/bcma.ko] undefined! ERROR: "of_irq_parse_one" [drivers/bcma/bcma.ko] undefined! This adds another compile-time check for OF_IRQ, but also gets rid of now unneeded #ifdef checks: Using the simpler IS_ENABLED() check for OF_IRQ also covers the case of not having CONFIG_OF enabled. The check for CONFIG_OF_ADDRESS was added to allow building on architectures without OF_ADDRESS, but that has been addressed already in b1d06b6 ("of: Provide static inline function for of_translate_address if needed"). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent 372f7d6 commit c58d900

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

drivers/bcma/main.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ static bool bcma_is_core_needed_early(u16 core_id)
136136
return false;
137137
}
138138

139-
#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
140139
static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
141140
struct bcma_device *core)
142141
{
@@ -184,7 +183,7 @@ static unsigned int bcma_of_get_irq(struct platform_device *parent,
184183
struct of_phandle_args out_irq;
185184
int ret;
186185

187-
if (!parent || !parent->dev.of_node)
186+
if (!IS_ENABLED(CONFIG_OF_IRQ) || !parent || !parent->dev.of_node)
188187
return 0;
189188

190189
ret = bcma_of_irq_parse(parent, core, &out_irq, num);
@@ -202,23 +201,15 @@ static void bcma_of_fill_device(struct platform_device *parent,
202201
{
203202
struct device_node *node;
204203

204+
if (!IS_ENABLED(CONFIG_OF_IRQ))
205+
return;
206+
205207
node = bcma_of_find_child_device(parent, core);
206208
if (node)
207209
core->dev.of_node = node;
208210

209211
core->irq = bcma_of_get_irq(parent, core, 0);
210212
}
211-
#else
212-
static void bcma_of_fill_device(struct platform_device *parent,
213-
struct bcma_device *core)
214-
{
215-
}
216-
static inline unsigned int bcma_of_get_irq(struct platform_device *parent,
217-
struct bcma_device *core, int num)
218-
{
219-
return 0;
220-
}
221-
#endif /* CONFIG_OF */
222213

223214
unsigned int bcma_core_irq(struct bcma_device *core, int num)
224215
{

0 commit comments

Comments
 (0)