Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932855AbcDLNyd (ORCPT ); Tue, 12 Apr 2016 09:54:33 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:36296 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756259AbcDLNya (ORCPT ); Tue, 12 Apr 2016 09:54:30 -0400 Subject: Re: [PATCH RFT 2/2] macb: kill PHY reset code To: Nicolas Ferre , Andrew Lunn References: <81129033.NXiOLTg1so@wasted.cogentembedded.com> <2811962.eGX2i5RJbZ@wasted.cogentembedded.com> <20160411022802.GB4307@lunn.ch> <570CBE42.50309@atmel.com> Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: Sergei Shtylyov Message-ID: <570CFE13.3040100@cogentembedded.com> Date: Tue, 12 Apr 2016 16:54:27 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <570CBE42.50309@atmel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1654 Lines: 54 Hello. On 4/12/2016 12:22 PM, Nicolas Ferre wrote: >>> With the 'phylib' now being aware of the "reset-gpios" PHY node property, >>> there should be no need to frob the PHY reset in this driver anymore... >>> >>> Signed-off-by: Sergei Shtylyov >>> >>> --- >>> drivers/net/ethernet/cadence/macb.c | 17 ----------------- >>> drivers/net/ethernet/cadence/macb.h | 1 - >>> 2 files changed, 18 deletions(-) >>> >>> Index: net-next/drivers/net/ethernet/cadence/macb.c >>> =================================================================== >>> --- net-next.orig/drivers/net/ethernet/cadence/macb.c >>> +++ net-next/drivers/net/ethernet/cadence/macb.c [...] >>> @@ -2977,18 +2976,6 @@ static int macb_probe(struct platform_de >>> else >>> macb_get_hwaddr(bp); >>> >>> - /* Power up the PHY if there is a GPIO reset */ >>> - phy_node = of_get_next_available_child(np, NULL); >>> - if (phy_node) { >>> - int gpio = of_get_named_gpio(phy_node, "reset-gpios", 0); >>> - >>> - if (gpio_is_valid(gpio)) { >>> - bp->reset_gpio = gpio_to_desc(gpio); >>> - gpiod_direction_output(bp->reset_gpio, 1); >> >> Hi Sergei >> >> The code you are deleting would of ignored the flags in the gpio > > I don't parse this. > The code deleted does take the flag into account. Not really -- you need to call of_get_named_gpio_flags() (with a valid last argument) for that. > And the DT property > associated to it seems correct to me (I mean, with proper flag > specification). It apparently is not as it have GPIO_ACTIVE_HIGH and the driver assumes active-low reset signal. [...] > Bye, MBR, Sergei