e38b5bc1c65042762556f6c06dc38ad3c111bb8b
[15.05/openwrt.git] / target / linux / bcm53xx / patches-3.14 / 121-bcma-get-irqs-from-dt.patch
1 From 6611afa6c49434780096cdf2c1028f0ac277f9bc Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Thu, 9 Jan 2014 19:40:14 +0100
4 Subject: [PATCH v3 2/2] bcma: get IRQ numbers from dt
5
6 It is not possible to auto detect the irq numbers used by the cores on
7 an arm SoC. If bcma was registered with device tree it will search for
8 some device tree nodes with the irq number and add it to the core
9 configuration.
10
11 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 ---
13  drivers/bcma/main.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
14  1 file changed, 48 insertions(+), 1 deletion(-)
15  
16 --- a/drivers/bcma/main.c
17 +++ b/drivers/bcma/main.c
18 @@ -10,6 +10,7 @@
19  #include <linux/platform_device.h>
20  #include <linux/bcma/bcma.h>
21  #include <linux/slab.h>
22 +#include <linux/of_irq.h>
23  #include <linux/of_address.h>
24  
25  MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
26 @@ -159,8 +160,10 @@ static void bcma_of_fill_device(struct p
27         struct device_node *node;
28  
29         node = bcma_of_find_child_device(parent, core);
30 -       if (node)
31 -               core->dev.of_node = node;
32 +       if (!node)
33 +               return;
34 +       core->dev.of_node = node;
35 +       core->irq = irq_of_parse_and_map(node, 0);
36  }
37  #else
38  static void bcma_of_fill_device(struct platform_device *parent,