1
0
Fork 0

MLK-22992 firmware: imx: scu-pd: fix wu_num

wu_num needs to be int type, u32 is not correct.

When "wakeup-irq" not included, of_property_count_u32_elems
will return a negative value. So use int.

And directly return when "wakeup-irq" not exists.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Peng Fan 2019-11-20 16:25:35 +08:00 committed by Dong Aisheng
parent eeaa64aa12
commit c6ec2917a6
1 changed files with 4 additions and 2 deletions

View File

@ -67,7 +67,7 @@
#define IMX_SIP_WAKEUP_SRC_IRQSTEER 0x2
static u32 wu[IMX_WU_MAX_IRQS];
static u32 wu_num;
static int wu_num;
static void __iomem *gic_dist_base;
/* SCU Power Mode Protocol definition */
@ -297,8 +297,10 @@ static void imx_sc_pd_enable_irqsteer_wakeup(struct device_node *np)
unsigned int i;
wu_num = of_property_count_u32_elems(np, "wakeup-irq");
if (wu_num <= 0)
if (wu_num <= 0) {
pr_warn("no irqsteer wakeup source supported!\n");
return;
}
gic_node = of_find_compatible_node(NULL, NULL, "arm,gic-v3");
WARN_ON(!gic_node);