Skip to content

Commit a38cfe3

Browse files
committed
[DM/OFW] Request a PIC platform device when no init
Some device is not a PIC driver but platform driver. We should request it auto. Signed-off-by: GuEe-GUI <[email protected]>
1 parent 4473ae3 commit a38cfe3

File tree

1 file changed

+9
-1
lines changed
  • components/drivers/ofw

1 file changed

+9
-1
lines changed

components/drivers/ofw/irq.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <drivers/ofw.h>
1515
#include <drivers/ofw_io.h>
1616
#include <drivers/ofw_irq.h>
17+
#include <drivers/platform.h>
1718

1819
#define DBG_TAG "rtdm.ofw"
1920
#define DBG_LVL DBG_INFO
@@ -525,8 +526,15 @@ struct rt_ofw_node *rt_ofw_find_irq_parent(struct rt_ofw_node *np, int *out_inte
525526
static int ofw_map_irq(struct rt_ofw_cell_args *irq_args)
526527
{
527528
int irq;
529+
struct rt_pic *pic;
528530
struct rt_ofw_node *ic_np = irq_args->data;
529-
struct rt_pic *pic = rt_pic_dynamic_cast(rt_ofw_data(ic_np));
531+
532+
if (!rt_ofw_data(ic_np))
533+
{
534+
rt_platform_ofw_request(ic_np);
535+
}
536+
537+
pic = rt_pic_dynamic_cast(rt_ofw_data(ic_np));
530538

531539
/* args.data is "interrupt-controller" */
532540
if (pic)

0 commit comments

Comments
 (0)