From patchwork Wed Mar 23 10:49:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Frias X-Patchwork-Id: 601187 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qVRC33VQQz9ssP for ; Wed, 23 Mar 2016 21:49:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=laposte.net header.i=@laposte.net header.b=FVVSdZcT; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752917AbcCWKtP (ORCPT ); Wed, 23 Mar 2016 06:49:15 -0400 Received: from smtpoutz28.laposte.net ([194.117.213.103]:42951 "EHLO smtp.laposte.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751611AbcCWKtN (ORCPT ); Wed, 23 Mar 2016 06:49:13 -0400 Received: from smtp.laposte.net (localhost [127.0.0.1]) by lpn-prd-vrout016 (Postfix) with ESMTP id CAE49111082 for ; Wed, 23 Mar 2016 11:49:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=mail1; t=1458730150; bh=yokWTDU00ybOBy1ROEiDCks/+1wHz5a8GGgrvuVCsrg=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=FVVSdZcTJgd9KnjAwrZc36Y9cFcmCJXFeShPdgB0o9QB0BGTLaGj+Za0O6q2xKt+d wnFFeBwCgII+2EjP8LCGdckGiw66jSij+byqFLe4CkHL1XaJD0ONYeM3iTPFy4J0Wl LT5hdoumgbvAtiXegHTz21AYAczARyZyjcN5duYtY1zsVtSn7C93uWJ/K0bVwaEeqJ +fiiblAXmeG9GYHrm4bWOiqBMe0UAOQy76NI+fzuBFvjrfuBtlZP+Nx/wC7h9UE2cf pqFlUtACTMQv1rbxg/g8KmvAOnhbuxSfCT5LpfgKBkFymTtbNc3eydMI/A9QLsA4RC 4SpXNSjz+rAqQ== Received: from lpn-prd-vrin003 (lpn-prd-vrin003.prosodie [10.128.63.4]) by lpn-prd-vrout016 (Postfix) with ESMTP id C8A32110E09 for ; Wed, 23 Mar 2016 11:49:10 +0100 (CET) Received: from lpn-prd-vrin003 (localhost [127.0.0.1]) by lpn-prd-vrin003 (Postfix) with ESMTP id B183D48C41F for ; Wed, 23 Mar 2016 11:49:10 +0100 (CET) Received: from [172.27.0.214] (ovpn12414.celeste.fr [83.142.147.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lpn-prd-vrin003 (Postfix) with ESMTPSA id 217E448C3F9; Wed, 23 Mar 2016 11:49:10 +0100 (CET) Message-ID: <56F274A5.6030502@laposte.net> Date: Wed, 23 Mar 2016 11:49:09 +0100 From: Sebastian Frias User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: =?windows-1252?Q?Uwe_Kleine-K=F6nig?= CC: Daniel Mack , "David S. Miller" , netdev@vger.kernel.org, lkml , mason , Florian Fainelli , Mans Rullgard , Fabio Estevam , Martin Blumenstingl , Linus Walleij Subject: [PATCH] net: phy: at803x: Request 'reset' GPIO only for AT8030 PHY References: <56E99727.9040702@laposte.net> <20160318125455.GN4292@pengutronix.de> <56EC2525.8000706@laposte.net> <20160318191242.GQ4292@pengutronix.de> <56EFEDAD.9030903@laposte.net> <20160321135457.GX4292@pengutronix.de> <56F0150F.8080804@laposte.net> <20160321201229.GA6191@pengutronix.de> <56F157EF.5080307@laposte.net> <20160322194224.GF6191@pengutronix.de> <56F26BF7.3090201@laposte.net> In-Reply-To: <56F26BF7.3090201@laposte.net> X-VR-SrcIP: 83.142.147.193 X-VR-FullState: 0 X-VR-Score: -100 X-VR-Cause-1: gggruggvucftvghtrhhoucdtuddrfeekkedrudeigddvtdcutefuodetggdotefrodftvfcurfhrohhf X-VR-Cause-2: ihhlvgemucfntefrqffuvffgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhs X-VR-Cause-3: ucdlqddutddtmdenucfjughrpefkfffhfgggvffufhgjtgfgsehtjegrtddtfeehnecuhfhrohhmpefu X-VR-Cause-4: vggsrghsthhirghnucfhrhhirghsuceoshhfkeegsehlrghpohhsthgvrdhnvghtqeenucfkphepkeef X-VR-Cause-5: rddugedvrddugeejrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghloheplgdu X-VR-Cause-6: jedvrddvjedrtddrvddugegnpdhinhgvthepkeefrddugedvrddugeejrdduleefpdhmrghilhhfrhho X-VR-Cause-7: mhepshhfkeegsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepuhdrkhhlvghinhgvqdhkohgvnhhi X-VR-Cause-8: ghesphgvnhhguhhtrhhonhhigidruggv X-VR-AvState: No X-VR-State: 0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This removes the dependency on GPIOLIB for non faulty PHYs. Indeed, without this patch, if GPIOLIB is not selected devm_gpiod_get_optional() will return -ENOSYS and the driver probe call will fail, regardless of the actual PHY hardware. Out of the 3 PHYs supported by this driver (AT8030, AT8031, AT8035), only AT8030 presents the issues that commit 13a56b449325 ("net: phy: at803x: Add support for hardware reset") attempts to work-around by using a 'reset' GPIO line. Hence, only AT8030 should depend on GPIOLIB operating properly. Fixes: 13a56b449325 ("net: phy: at803x: Add support for hardware reset") Signed-off-by: Sebastian Frias --- drivers/net/phy/at803x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 2174ec9..dcecf25 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -251,12 +251,16 @@ static int at803x_probe(struct phy_device *phydev) if (!priv) return -ENOMEM; + if (phydev->drv->phy_id != ATH8030_PHY_ID) + goto does_not_require_reset_workaround; + gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(gpiod_reset)) return PTR_ERR(gpiod_reset); priv->gpiod_reset = gpiod_reset; +does_not_require_reset_workaround: phydev->priv = priv; return 0;