netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Bauer <mail@david-bauer.net>
Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/3] net: phy: add support for reset-controller
Date: Mon, 15 Apr 2019 19:01:04 +0200	[thread overview]
Message-ID: <20190415170104.GC9343@lunn.ch> (raw)
In-Reply-To: <20190415123840.31407-2-mail@david-bauer.net>

On Mon, Apr 15, 2019 at 02:38:39PM +0200, David Bauer wrote:
> +static int mdiobus_register_reset(struct mdio_device *mdiodev)
> +{
> +	struct reset_control *reset = NULL;
> +
> +	if (mdiodev->dev.of_node)
> +		reset = devm_reset_control_get_exclusive(&mdiodev->dev,
> +							 "phy");
> +	if (PTR_ERR(reset) == -ENOENT ||
> +	    PTR_ERR(reset) == -ENOTSUPP)
> +		reset = NULL;
> +	else if (IS_ERR(reset))
> +		return PTR_ERR(reset);
> +
> +	mdiodev->reset_ctrl = reset;
> +
> +	/* Assert the reset signal */
> +	mdio_device_reset(mdiodev, 1);

Hi David

The mdiobus_register_gpiod() function also has a call to
mdio_device_reset(). So we end up resetting the GPIO twice.

It is probably better to pull this out of here, and
mdiobus_register_gpiod(), and do it once in mdiobus_register_device().

	  Andrew

  reply	other threads:[~2019-04-15 17:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 12:38 [PATCH 1/3] dt-bindings: net: add PHY reset controller binding David Bauer
2019-04-15 12:38 ` [PATCH 2/3] net: phy: add support for reset-controller David Bauer
2019-04-15 17:01   ` Andrew Lunn [this message]
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
2019-04-15 17:02   ` Andrew Lunn
2019-04-15 23:04   ` kbuild test robot
2019-04-16  2:21   ` kbuild test robot
2019-04-16  2:29   ` kbuild test robot
2019-04-15 17:04 ` [PATCH 1/3] dt-bindings: net: add PHY reset controller binding 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=20190415170104.GC9343@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=mail@david-bauer.net \
    --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;
as well as URLs for NNTP newsgroup(s).