Re: [PATCH 2/3] net: phy: add support for reset-controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux