public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Pavel Nakonechny <pavel.nakonechny@skitlab.ru>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Fabian Frederick <fabf@skynet.be>,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	Joe Perches <joe@perches.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: dsa: fix filling rtable from OF description
Date: Sat, 4 Apr 2015 23:00:32 +0200	[thread overview]
Message-ID: <20150404210032.GB19428@lunn.ch> (raw)
In-Reply-To: <43287962.B6uVbMGNYa@kuro.zhome>

On Sat, Apr 04, 2015 at 08:10:09PM +0300, Pavel Nakonechny wrote:
> Hi Andrew
> 
> ?? ???????????? ???? 4 ???????????? 2015 18:38:14 ???????????????????????? Andrew Lunn ??????????????:
> > There is the code after applying your patch:
> > 
> > static int dsa_of_setup_routing_table(struct dsa_platform_data *pd,
> >                                         struct dsa_chip_data *cd,
> >                                         int chip_index, int port_index,
> >                                         struct device_node *link)
> > {
> >         const __be32 *reg;
> >         int link_sw_addr;
> >         struct device_node *parent_sw;
> >         int len;
> > 
> >         parent_sw = of_get_parent(link);
> >         if (!parent_sw)
> >                 return -EINVAL;
> > 
> > link is the phandle to the port in other switch. parent_sw is then the
> > switch property.
> yep
> 
> >         reg = of_get_property(parent_sw, "reg", &len);
> >         if (!reg || (len != sizeof(*reg) * 2))
> >                 return -EINVAL;
> > 
> > So now you get the reg property. This is documented as:
> > 
> > - reg                   : Describes the switch address on the MII bus
> Yes, but read further in the entry example:
> "reg = <16 0>;	/* MDIO address 16, switch 0 in tree */"

Ah!

O.K. Please add a comment. If i read this wrong, it is quite likely
somebody else will also read this wrong.

I think it would also be good to add some text to dsa.txt explaining
this second field in reg.

     Andrew

  reply	other threads:[~2015-04-04 21:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 13:48 [PATCH] net: dsa: fix filling rtable from OF description Pavel Nakonechny
2015-04-04 16:38 ` Andrew Lunn
2015-04-04 17:10   ` Pavel Nakonechny
2015-04-04 21:00     ` Andrew Lunn [this message]
2015-04-04 21:02 ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150404210032.GB19428@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=fabf@skynet.be \
    --cc=grant.likely@linaro.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavel.nakonechny@skitlab.ru \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox