From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756627AbcCRTNA (ORCPT ); Fri, 18 Mar 2016 15:13:00 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:54503 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbcCRTM5 (ORCPT ); Fri, 18 Mar 2016 15:12:57 -0400 Date: Fri, 18 Mar 2016 20:12:42 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Sebastian Frias Cc: Daniel Mack , "David S. Miller" , netdev@vger.kernel.org, lkml , mason , Florian Fainelli , Mans Rullgard , Fabio Estevam , Martin Blumenstingl , Linus Walleij Subject: Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB Message-ID: <20160318191242.GQ4292@pengutronix.de> References: <56E99727.9040702@laposte.net> <20160318125455.GN4292@pengutronix.de> <56EC2525.8000706@laposte.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56EC2525.8000706@laposte.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Sebastian, On Fri, Mar 18, 2016 at 04:56:21PM +0100, Sebastian Frias wrote: > On 03/18/2016 01:54 PM, Uwe Kleine-König wrote: > > From a driver perspecitive, it would be nice if devm_gpiod_get_optional > > returned NULL iff the respective gpio isn't specified even with > > GPIOLIB=n, but this isn't sensible either because it would result in > > quite some gpiolib code to not being conditionally compiled on > > CONFIG_GPIOLIB any more. > > Let's say that was the case, what would the PHY code do? With reset gpios it might not be that critical, but consider an optional enable gpio. (Optional in the sense, that some device have it and others don't, e.g. because the pin is pulled into active level by hardware.) Now you do: gpiod = gpiod_get_optional("enable"); and if gpiod now is an error pointer, you must assume that you cannot operate the device. And even with GPIOLIB=n (and gpiod = ERR_PTR(-ENOSYS)) you cannot ignore the error. For consistency I'd recommend to do the same for reset even though there is a chance to get a working device. > What would you think of making at803x_link_change_notify() print a > message every time it should do a reset but does not has a way to do it? Then this question is obsolete because the device doesn't probe. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |