All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net,
	Maciej Machnikowski <maciej.machnikowski@intel.com>,
	netdev@vger.kernel.org, richardcochran@gmail.com,
	Sunitha Mekala <sunithax.d.mekala@intel.com>
Subject: Re: [PATCH net-next 3/4] ice: Add support for SMA control multiplexer
Date: Wed, 13 Oct 2021 16:19:09 -0700	[thread overview]
Message-ID: <20211013161909.735f2f17@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20211012163153.2104212-4-anthony.l.nguyen@intel.com>

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;

  reply	other threads:[~2021-10-13 23:19 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 [this message]
2021-10-14 15:17     ` Nguyen, Anthony L
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=20211013161909.735f2f17@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --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 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.