> > From: Bin Meng [mailto:bmeng...@gmail.com]
> > Sent: Thursday, August 08, 2019 3:52 PM
> > To: Lukas Auer; Rick Jian-Zhi Chen(陳建志); U-Boot Mailing List
> > Subject: [PATCH] riscv: cpu: Skip unavailable hart in the get_count() op
> >
> > We should not count in hart that is marked as not available in the device 
> > tree
> > in riscv_cpu_get_count().
> >
> > Signed-off-by: Bin Meng <bmeng...@gmail.com>
> > ---
> >
> >  drivers/cpu/riscv_cpu.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/cpu/riscv_cpu.c b/drivers/cpu/riscv_cpu.c index
> > f77c126..28ad0aa 100644
> > --- a/drivers/cpu/riscv_cpu.c
> > +++ b/drivers/cpu/riscv_cpu.c
> > @@ -46,6 +46,10 @@ static int riscv_cpu_get_count(struct udevice *dev)
> >       ofnode_for_each_subnode(node, dev_ofnode(dev->parent)) {
> >               const char *device_type;
> >
> > +             /* skip if hart is marked as not available in the device tree 
> > */
> > +             if (!ofnode_is_available(node))
> > +                     continue;
> > +
> >               device_type = ofnode_read_string(node, "device_type");
> >               if (!device_type)
> >                       continue;
> > --
> > 2.7.4
>

Reviewed-by: Rick Chen <r...@andestech.com>
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to