lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 26 Jan 2013 02:04:13 +0100
From:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:	Guennadi Liakhovetski <g.liakhovetski@....de>
Cc:	linux-sh@...r.kernel.org, Magnus Damm <magnus.damm@...il.com>,
	Simon Horman <horms@...ge.net.au>,
	linux-arm-kernel@...ts.infradead.org,
	devicetree-discuss@...ts.ozlabs.org, netdev@...r.kernel.org
Subject: Re: [PATCH/RFC 2/3] ethernet: add a PHY reset GPIO DT binding to sh_eth

Hi Guennadi,

On Friday 25 January 2013 11:34:55 Guennadi Liakhovetski wrote:
> On Fri, 25 Jan 2013, Laurent Pinchart wrote:
> > On Thursday 24 January 2013 17:07:32 Guennadi Liakhovetski wrote:
> > > If an ethernet PHY can be reset by a GPIO, it can be specified in DT.
> > > Add a binding and code to parse it, request the GPIO and take the PHY
> > > out of reset.
> > > 
> > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@....de>
> > > Cc: devicetree-discuss@...ts.ozlabs.org
> > > Cc: netdev@...r.kernel.org
> > > ---
> > > 
> > >  Documentation/devicetree/bindings/net/sh_ether.txt |    2 ++
> > >  drivers/net/ethernet/renesas/sh_eth.c              |    9 ++++++++-
> > >  2 files changed, 10 insertions(+), 1 deletions(-)

[snip]

> > > diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> > > b/drivers/net/ethernet/renesas/sh_eth.c index 1f64848..06035a2 100644
> > > --- a/drivers/net/ethernet/renesas/sh_eth.c
> > > +++ b/drivers/net/ethernet/renesas/sh_eth.c

[snip]

> > > @@ -2420,6 +2423,10 @@ sh_eth_parse_dt(struct device *dev, struct
> > > net_device *ndev) else
> > > 
> > >  		pdata->needs_init = 0;
> > > 
> > > +	gpio = of_get_named_gpio_flags(np, "phy-reset-gpios", 0, &flags);
> > > +	if (gpio_is_valid(gpio) && !devm_gpio_request(dev, gpio, NULL))
> > > +		gpio_direction_output(gpio, !!(flags & OF_GPIO_ACTIVE_LOW));
> > 
> > You could use devm_gpio_request_one() here.
> 
> Yes, but then the flag would look uglier, something like
> 
> 		devm_gpio_request_one(dev, gpio, flags &
> 			OF_GPIO_ACTIVE_LOW ? GPIOF_OUT_INIT_HIGH :
> 			GPIOF_OUT_INIT_LOW);
> 
> Does it really look like an improvement? :)

It's one less function call, so to me it does :-) Feel free to ignore that 
though.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists