From: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>
To: "kuba@kernel.org" <kuba@kernel.org>
Cc: "Machnikowski, Maciej" <maciej.machnikowski@intel.com>,
"richardcochran@gmail.com" <richardcochran@gmail.com>,
"Mekala, SunithaX D" <sunithax.d.mekala@intel.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 3/4] ice: Add support for SMA control multiplexer
Date: Thu, 14 Oct 2021 15:17:08 +0000 [thread overview]
Message-ID: <048af8333ca4503ff61a2e007e934f9441f98dd2.camel@intel.com> (raw)
In-Reply-To: <20211013161909.735f2f17@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Wed, 2021-10-13 at 16:19 -0700, Jakub Kicinski wrote:
> On Tue, 12 Oct 2021 09:31:52 -0700 Tony Nguyen wrote:
> > From: Maciej Machnikowski <maciej.machnikowski@intel.com>
> >
> > E810-T adapters have two external bidirectional SMA connectors and
> > two
> > internal unidirectional U.FL connectors. Multiplexing between U.FL
> > and
> > SMA and SMA direction is controlled using the PCA9575 expander.
> >
> > Add support for the PCA9575 detection and control of the respective
> > pins
> > of the SMA/U.FL multiplexer using the GPIO AQ API.
>
> > +static int
> > +ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle)
> > +{
> > + struct ice_aqc_get_link_topo *cmd;
> > + struct ice_aq_desc desc;
> > + int status;
> > + u8 idx;
> > +
> > + if (!hw || !pca9575_handle)
> > + return -EINVAL;
>
> Looks like purest form of defensive programming, please drop this.
>
> > +bool ice_is_pca9575_present(struct ice_hw *hw)
> > +{
> > + u16 handle = 0;
> > + int status;
> > +
> > + if (!ice_is_e810t(hw))
> > + return false;
> > +
> > + status = ice_get_pca9575_handle(hw, &handle);
> > + if (!status && handle)
> > + return true;
> > +
> > + return false;
> > +}
>
> return !status && handle;
Thanks for the review Jakub. Will make these adjustments as well as the
one from patch 4.
-Tony
next prev parent reply other threads:[~2021-10-14 15:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 16:31 [PATCH net-next 0/4][pull request] 100GbE Intel Wired LAN Driver Updates 2021-10-12 Tony Nguyen
2021-10-12 16:31 ` [PATCH net-next 1/4] ice: Refactor ice_aqc_link_topo_addr Tony Nguyen
2021-10-12 16:31 ` [PATCH net-next 2/4] ice: Implement functions for reading and setting GPIO pins Tony Nguyen
2021-10-12 16:31 ` [PATCH net-next 3/4] ice: Add support for SMA control multiplexer Tony Nguyen
2021-10-13 23:19 ` Jakub Kicinski
2021-10-14 15:17 ` Nguyen, Anthony L [this message]
2021-10-12 16:31 ` [PATCH net-next 4/4] ice: Implement support for SMA and U.FL on E810-T Tony Nguyen
2021-10-13 23:17 ` Jakub Kicinski
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=048af8333ca4503ff61a2e007e934f9441f98dd2.camel@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=maciej.machnikowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=sunithax.d.mekala@intel.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;
as well as URLs for NNTP newsgroup(s).