[PATCH 4/8] dm: Introduce xxx_get_dma_range()

Nicolas Saenz Julienne nsaenzjulienne at suse.de
Wed Dec 9 17:30:55 CET 2020


On Wed, 2020-12-09 at 13:58 +0100, Matthias Brugger wrote:
[...]
> > +
> > +	/* switch to that node */
> > +	parent = of_get_parent(dev);
> > +	if (!parent) {
> > +		printf("Found dma-ranges in root node, shoudln't happen\n");
> > +		ret = -EINVAL;
> > +		goto out;
> > +	}
> 
> Aren't we missing a of_node_put(parent) here?

Yes, that's right.

> > +
> > +	/* Get the address sizes both for the bus and its parent */
> > +	of_match_bus(dev)->count_cells(dev, &na, &ns);
> 
> of_bus = of_match_bus(dev);
> of_bus->count_cells(...)

OK

[...]

> > diff --git a/drivers/core/read.c b/drivers/core/read.c
> > index 076125824c..b835e82be9 100644
> > --- a/drivers/core/read.c
> > +++ b/drivers/core/read.c
> > @@ -338,6 +338,11 @@ u64 dev_translate_dma_address(const struct udevice *dev, const fdt32_t *in_addr)
> >  	return ofnode_translate_dma_address(dev_ofnode(dev), in_addr);
> >  }
> >  
> > 
> > +u64 dev_translate_cpu_address(const struct udevice *dev, const fdt32_t *in_addr)
> > +{
> > +	return ofnode_translate_cpu_address(dev_ofnode(dev), in_addr);
> > +}
> > +
> 
> Dead code, please delete.

Yes, sorry for that.

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201209/416dd672/attachment.sig>


More information about the U-Boot mailing list