From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Subject: Re: [PATCH] net: dsa: ksz: Add reset GPIO handling Date: Fri, 7 Dec 2018 22:52:06 +0100 Message-ID: <5ce03cb7-b689-b332-2746-937b290cb840@denx.de> References: <20181207174401.10889-1-marex@denx.de> <20181207195528.GD1294@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, f.fainelli@gmail.com, vivien.didelot@savoirfairelinux.com, Woojung.Huh@microchip.com, UNGLinuxDriver@microchip.com, "David S . Miller" , Tristram Ha To: Andrew Lunn Return-path: Received: from mail-out.m-online.net ([212.18.0.9]:44254 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbeLGVwK (ORCPT ); Fri, 7 Dec 2018 16:52:10 -0500 In-Reply-To: <20181207195528.GD1294@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/07/2018 08:55 PM, Andrew Lunn wrote: >> + dev->reset_gpio = -1; >> + reset_gpio = of_get_named_gpio_flags(np, "reset-gpios", 0, >> + &reset_gpio_flags); >> + if (reset_gpio >= 0) { >> + flags = (reset_gpio_flags == OF_GPIO_ACTIVE_LOW) ? >> + GPIOF_ACTIVE_LOW : 0; > > Can you use devm_gpiod_get_optional()? It makes this a lot simpler. > Take a look at mv88e6xxx/chip.c which also uses a GPIO for reset. Done > You also need to update the binding documentation for this new > property. Will do in a separate patch. -- Best regards, Marek Vasut