From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH] net: dsa: ksz: Add reset GPIO handling Date: Fri, 7 Dec 2018 20:55:28 +0100 Message-ID: <20181207195528.GD1294@lunn.ch> References: <20181207174401.10889-1-marex@denx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Marek Vasut Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:38321 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726172AbeLGTza (ORCPT ); Fri, 7 Dec 2018 14:55:30 -0500 Content-Disposition: inline In-Reply-To: <20181207174401.10889-1-marex@denx.de> Sender: netdev-owner@vger.kernel.org List-ID: > + 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. You also need to update the binding documentation for this new property. Andrew