From: Antoine Tenart <antoine.tenart@bootlin.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com,
hkallweit1@gmail.com, alexandre.belloni@bootlin.com,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
allan.nielsen@microchip.com, foss@0leil.net
Subject: Re: [PATCH net-next v4 6/8] net: phy: mscc: timestamping and PHC support
Date: Thu, 25 Jun 2020 15:38:54 +0200 [thread overview]
Message-ID: <159309233393.397581.16273630291558095966@kwain> (raw)
In-Reply-To: <20200625132226.GC2548@localhost>
Hello Richard,
Quoting Richard Cochran (2020-06-25 15:22:26)
> On Tue, Jun 23, 2020 at 04:30:12PM +0200, Antoine Tenart wrote:
> > @@ -978,9 +1483,32 @@ static int __vsc8584_init_ptp(struct phy_device *phydev)
> >
> > vsc85xx_ts_eth_cmp1_sig(phydev);
> >
> > + vsc8531->mii_ts.rxtstamp = vsc85xx_rxtstamp;
> > + vsc8531->mii_ts.txtstamp = vsc85xx_txtstamp;
> > + vsc8531->mii_ts.hwtstamp = vsc85xx_hwtstamp;
> > + vsc8531->mii_ts.ts_info = vsc85xx_ts_info;
> > + phydev->mii_ts = &vsc8531->mii_ts;
> > +
> > + memcpy(&vsc8531->ptp->caps, &vsc85xx_clk_caps, sizeof(vsc85xx_clk_caps));
> > +
> > + vsc8531->ptp->ptp_clock = ptp_clock_register(&vsc8531->ptp->caps,
> > + &phydev->mdio.dev);
> > + if (IS_ERR(vsc8531->ptp->ptp_clock))
> > + return PTR_ERR(vsc8531->ptp->ptp_clock);
>
> The ptp_clock_register() method can also return NULL:
>
> * Returns a valid pointer on success or PTR_ERR on failure. If PHC
> * support is missing at the configuration level, this function
> * returns NULL, and drivers are expected to gracefully handle that
> * case separately.
If ptp_clock_register returns NULL because PHC support is missing, the
clock won't be exported. Beside that, I don't think we can do much in
the error path, so this should be safe.
Thanks,
Antoine
--
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2020-06-25 13:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 14:30 [PATCH net-next v4 0/8] net: phy: mscc: PHC and timestamping support Antoine Tenart
2020-06-23 14:30 ` [PATCH net-next v4 1/8] net: phy: add support for a common probe between shared PHYs Antoine Tenart
2020-06-23 14:30 ` [PATCH net-next v4 2/8] net: phy: mscc: fix copyright and author information in MACsec Antoine Tenart
2020-06-23 14:30 ` [PATCH net-next v4 3/8] net: phy: mscc: remove the TR CLK disable magic value Antoine Tenart
2020-06-23 14:30 ` [PATCH net-next v4 4/8] net: phy: mscc: take into account the 1588 block in MACsec init Antoine Tenart
2020-06-23 14:30 ` [PATCH net-next v4 5/8] net: phy: mscc: 1588 block initialization Antoine Tenart
2020-06-25 11:52 ` Dan Carpenter
2020-06-23 14:30 ` [PATCH net-next v4 6/8] net: phy: mscc: timestamping and PHC support Antoine Tenart
2020-06-25 13:22 ` Richard Cochran
2020-06-25 13:38 ` Antoine Tenart [this message]
2020-06-23 14:30 ` [PATCH net-next v4 7/8] dt-bindings: net: phy: vsc8531: document the load/save GPIO Antoine Tenart
2020-06-23 14:30 ` [PATCH net-next v4 8/8] MIPS: dts: ocelot: describe " Antoine Tenart
2020-06-24 21:33 ` [PATCH net-next v4 0/8] net: phy: mscc: PHC and timestamping support David Miller
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=159309233393.397581.16273630291558095966@kwain \
--to=antoine.tenart@bootlin.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=allan.nielsen@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=foss@0leil.net \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox