From: Richard Cochran <richardcochran@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
David Miller <davem@davemloft.net>,
Jacob Keller <jacob.e.keller@intel.com>,
Mark Rutland <mark.rutland@arm.com>,
Miroslav Lichvar <mlichvar@redhat.com>,
Rob Herring <robh+dt@kernel.org>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH V2 net-next 4/5] net: mdio: of: Register discovered MII time stampers.
Date: Sun, 7 Oct 2018 12:26:27 -0700 [thread overview]
Message-ID: <20181007192627.33nfcc27mvyqxbdy@localhost> (raw)
In-Reply-To: <20181007181754.GA22794@lunn.ch>
On Sun, Oct 07, 2018 at 08:17:54PM +0200, Andrew Lunn wrote:
> > > + if (err == -ENOENT)
> > > + return NULL;
> > > + else if (err)
> > > + return ERR_PTR(err);
> > > +
> > > + if (args.args_count >= 1)
> > > + port = args.args[0];
> >
> > If it's greater than one, than it is an error, and it should be flagged
> > as such.
> >
> > The idea looks good though, should of_find_mii_timestamper() somehow be
> > made conditional to CONFIG_PTP and we should have a stub for when it is
> > disabled?
>
> Hi Florian
>
> There already is a stub. But register return -EOPNOTSUPP.
The stub returns NULL...
> > > + return register_mii_timestamper(args.np, port);
>
> So this returns EOPNOTUP
NULL...
> > > static int of_mdiobus_register_phy(struct mii_bus *mdio,
> > > struct device_node *child, u32 addr)
> > > {
> > > + struct mii_timestamper *mii_ts;
> > > struct phy_device *phy;
> > > bool is_c45;
> > > int rc;
> > > u32 phy_id;
> > >
> > > + mii_ts = of_find_mii_timestamper(child);
> > > + if (IS_ERR(mii_ts))
> > > + return PTR_ERR(mii_ts);
> > > +
>
> and this returns EOPNOPTSUPP, so the PHY is not registered :-(
and the phydev.mii_ts field is then set to NULL.
Thanks,
Richard
next prev parent reply other threads:[~2018-10-07 19:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-07 17:38 [PATCH V2 net-next 4/5] net: mdio: of: Register discovered MII time stampers Richard Cochran
2018-10-07 18:14 ` Florian Fainelli
2018-10-07 18:17 ` Andrew Lunn
2018-10-07 19:26 ` Richard Cochran [this message]
2018-10-07 19:57 ` Andrew Lunn
2018-10-07 19:23 ` Richard Cochran
2018-10-07 18:19 ` 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=20181007192627.33nfcc27mvyqxbdy@localhost \
--to=richardcochran@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=jacob.e.keller@intel.com \
--cc=mark.rutland@arm.com \
--cc=mlichvar@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=willemb@google.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.