All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "Joe Hershberger" <joe.hershberger@ni.com>,
	"Ramon Fried" <rfried.dev@gmail.com>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	"Stefano Babic" <sbabic@denx.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	dl-uboot-imx <uboot-imx@nxp.com>,
	"Marek BehĂșn" <marek.behun@nic.cz>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Anatolij Gustschin" <agust@denx.de>
Subject: Re: [PATCH v3 7/8] net: add MV88E61xx DSA driver
Date: Tue, 21 Jun 2022 08:11:06 -0700	[thread overview]
Message-ID: <CAJ+vNU1px0TZcVpo53hoRkWx97mxcgya4SOXk6AJwR_ZeAr06g@mail.gmail.com> (raw)
In-Reply-To: <20220621072104.ql6l6qygeqvevrpr@skbuf>

On Tue, Jun 21, 2022 at 12:21 AM Vladimir Oltean
<vladimir.oltean@nxp.com> wrote:
>
> On Mon, Jun 20, 2022 at 04:37:45PM -0700, Tim Harvey wrote:
> > On Mon, Jun 20, 2022 at 4:58 AM Vladimir Oltean
> > <vladimir.oltean@nxp.com> wrote:
> > >
> > > On Mon, May 23, 2022 at 11:25:48AM -0700, Tim Harvey wrote:
> > > > +/* bind and probe the switch mdios */
> > > > +static int mv88e61xx_dsa_probe_mdio(struct udevice *dev)
> > > > +{
> > > > +     struct udevice *pdev;
> > > > +     ofnode node, mdios;
> > > > +     const char *name;
> > > > +     int ret;
> > > > +
> > > > +     /* bind phy ports of mdios child node to mv88e61xx_mdio device */
> > > > +     mdios = dev_read_subnode(dev, "mdios");
> > > > +     if (ofnode_valid(mdios)) {
> > > > +             ofnode_for_each_subnode(node, mdios) {
> > > > +                     name = ofnode_get_name(node);
> > > > +                     ret = device_bind_driver_to_node(dev,
> > > > +                                                      "mv88e61xx_mdio",
> > > > +                                                      name, node, &pdev);
> > > > +                     if (ret) {
> > > > +                             dev_err(dev, "failed to bind %s: %d\n", name, ret);
> > > > +                             continue;
> > > > +                     }
> > > > +
> > > > +                     /* need to probe it as there is no compatible to do so */
> > > > +                     ret = uclass_get_device_by_ofnode(UCLASS_MDIO, node, &pdev);
> > > > +                     if (ret) {
> > > > +                             dev_err(dev, "failed to probe %s: %d\n", name, ret);
> > > > +                             continue;
> > > > +                     }
> > >
> > > What do you do with this pdev once you get it? Are you missing a device_probe() call?
> > > Also, why "pdev" and not "dev"? What does the "p" stand for?
> >
> > struct udevice *dev is passed into the function so I use pdev to
> > iterate over the ports in the mdios node so 'pdev' means 'port' here.
>
> Yes, but those under the mdios node aren't ports, they're MDIO
> controllers, hence my comment.

how about devp (dev pointer) or subdev or mdio?

Tim

>
> > I do not need to do anything with pdev but I must use
> > uclass_get_device_by_ofnode() to probe it and that function requires
> > it. I don't need to call device_probe because
> > uclass_get_device_by_ofnode does it for me
>
> Ok, I didn't notice they all call uclass_get_device_tail() which calls
> device_probe().

  reply	other threads:[~2022-06-21 15:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 18:25 [PATCH v3 0/8] Add MV88E61xx DSA driver and use on gwventana Tim Harvey
2022-05-23 18:25 ` [PATCH v3 1/8] net: mdio-uclass: scan for dm mdio children on post-bind Tim Harvey
2022-05-23 18:25 ` [PATCH v3 2/8] net: dsa: move cpu port probe to dsa_post_probe Tim Harvey
2022-05-23 18:25 ` [PATCH v3 3/8] net: dsa: ensure dsa driver has proper ops Tim Harvey
2022-05-23 18:25 ` [PATCH v3 4/8] net: dsa: allow rcv() and xmit() to be optional Tim Harvey
2022-05-23 18:25 ` [PATCH v3 5/8] net: ksz9477: remove unnecessary xmit and recv functions Tim Harvey
2022-05-23 18:25 ` [PATCH v3 6/8] net: fec: add support for DM_MDIO Tim Harvey
2022-05-23 18:25 ` [PATCH v3 7/8] net: add MV88E61xx DSA driver Tim Harvey
2022-06-20 11:58   ` Vladimir Oltean
2022-06-20 23:37     ` Tim Harvey
2022-06-21  7:21       ` Vladimir Oltean
2022-06-21 15:11         ` Tim Harvey [this message]
2022-06-23 12:43           ` Vladimir Oltean
2022-08-07  0:07             ` Ramon Fried
2022-08-08 15:21               ` Tim Harvey
2022-05-23 18:25 ` [PATCH v3 8/8] board: gw_ventana: enable MV88E61XX DSA support Tim Harvey
2022-06-14 17:00   ` Tim Harvey
2022-06-14 18:55     ` Vladimir Oltean
2022-06-20 11:42   ` Vladimir Oltean
2022-06-21 16:57     ` Tim Harvey
2022-06-23 12:42       ` Vladimir Oltean
2022-06-23 16:07         ` Tim Harvey
2022-06-24 10:25   ` Vladimir Oltean
2022-06-24 23:16     ` Tim Harvey
2022-06-25  0:13       ` Vladimir Oltean
2022-06-25  0:25         ` Tim Harvey

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=CAJ+vNU1px0TZcVpo53hoRkWx97mxcgya4SOXk6AJwR_ZeAr06g@mail.gmail.com \
    --to=tharvey@gateworks.com \
    --cc=agust@denx.de \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=festevam@gmail.com \
    --cc=joe.hershberger@ni.com \
    --cc=marek.behun@nic.cz \
    --cc=rfried.dev@gmail.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=vladimir.oltean@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.