From: Richard Cochran <richardcochran@gmail.com>
To: Atul Gupta <atul.gupta@chelsio.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, ganeshgr@chelsio.com
Subject: Re: [PATCH net-next 2/3] cxgb4: Add PTP Hardware Clock (PHC) support
Date: Mon, 10 Jul 2017 21:23:54 +0200 [thread overview]
Message-ID: <20170710192354.dyd2gr5wt6m7wksf@localhost.localdomain> (raw)
In-Reply-To: <1499166982-4875-3-git-send-email-atul.gupta@chelsio.com>
On Tue, Jul 04, 2017 at 04:46:21PM +0530, Atul Gupta wrote:
> +/**
> + * cxgb4_ptp_init - initialize PTP for devices which support it
> + * @adapter: board private structure
> + *
> + * This function performs the required steps for enabling PTP support.
> + */
> +void cxgb4_ptp_init(struct adapter *adapter)
> +{
> + struct timespec64 now;
> + /* no need to create a clock device if we already have one */
> + if (!IS_ERR_OR_NULL(adapter->ptp_clock))
> + return;
> +
> + adapter->ptp_tx_skb = NULL;
> + adapter->ptp_clock_info = cxgb4_ptp_clock_info;
> + spin_lock_init(&adapter->ptp_lock);
> +
> + adapter->ptp_clock = ptp_clock_register(&adapter->ptp_clock_info,
> + &adapter->pdev->dev);
> + if (!adapter->ptp_clock) {
> + dev_err(adapter->pdev_dev,
> + "PTP %s Clock registration has failed\n", __func__);
> + return;
> + }
This is wrong. To quote the header file:
/**
* ptp_clock_register() - register a PTP hardware clock driver
*
* @info: Structure describing the new clock.
* @parent: Pointer to the parent device of the new clock.
*
* 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.
*/
As this has already been merged, please submit a patch to properly
handle both PTR_ERR and NULL.
Thanks,
Richard
next prev parent reply other threads:[~2017-07-10 19:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 11:16 [PATCH net-next 0/3] cxgb4: Add PTP Hardware Clock (PHC) support Atul Gupta
2017-07-04 11:16 ` [PATCH net-next 1/3] cxgb4: time stamping interface for PTP Atul Gupta
2017-07-04 11:16 ` [PATCH net-next 2/3] cxgb4: Add PTP Hardware Clock (PHC) support Atul Gupta
2017-07-10 19:23 ` Richard Cochran [this message]
2017-07-04 11:16 ` [PATCH net-next 3/3] cxgb4: Support for get_ts_info ethtool method Atul Gupta
2017-07-05 8:22 ` [PATCH net-next 0/3] cxgb4: Add PTP Hardware Clock (PHC) 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=20170710192354.dyd2gr5wt6m7wksf@localhost.localdomain \
--to=richardcochran@gmail.com \
--cc=atul.gupta@chelsio.com \
--cc=davem@davemloft.net \
--cc=ganeshgr@chelsio.com \
--cc=netdev@vger.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