Hi,
On Tue, Jun 18, 2013 at 10:43:55AM +0200, Sebastian Andrzej Siewior wrote:
> >> --- a/drivers/usb/musb/musb_dsps.c +++
> >> b/drivers/usb/musb/musb_dsps.c @@ -110,8 +110,6 @@ struct
> >> dsps_musb_wrapper { @@ -646,6 +645,23 @@ static int
> >> dsps_probe(struct platform_device *pdev) }
> >> platform_set_drvdata(pdev, glue);
> >>
> >> + i = 1; + do { + iomem = platform_get_resource(pdev,
> >> IORESOURCE_MEM, i);
> >
> > IIRC this index starts at zero, no ? Meaning that this should be:
> >
> > i = 0 do { iomem = platform_get_resource(pdev, IORESOURCE_MEM, i);
> > if (!iomem) break;
> >
> > i++; } while (true);
> >
> > glue->instances = i + 1;
>
> No. 3x ioadress i.e. 0, 1, 2 means two instances because we have 0 as
> the glue io address and two musb port (1 and 2).heh, true. > > Also, why are you getting the resource and doing nothing with it ? > > Is it just to figure out the amount of instances ? Isn't there a DT > > helper to > > exactly, just to count. > > > count how many child nodes a certain node has ? > This isn't exactly a child node, is it? There is of_get_child_count() > but this isn't a child, it is one property. is it because we haven't added DTS support for musb core ? Eventually we can/should add and convert this to of_get_child_count() then. For now, we can go ahead with your approach. We have such a large amount of function pointers to sort out anyway :-( -- balbi
signature.asc
Description: Digital signature
