From patchwork Wed Nov 18 14:24:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 327424 Delivered-To: patch@linaro.org Received: by 2002:a17:906:d156:0:0:0:0 with SMTP id br22csp460647ejb; Wed, 18 Nov 2020 06:25:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwb3eS6aOiDwvy8xUIbew13oBUkD6iVODm9p+BsWFI+d5X6cQLb9Jd8idpMx8qsWFaXNTau X-Received: by 2002:a05:6402:38a:: with SMTP id o10mr2844213edv.349.1605709511661; Wed, 18 Nov 2020 06:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605709511; cv=none; d=google.com; s=arc-20160816; b=o+BRDP2Ha8FFTutGOsF4V94CiUSuxLoBOglKl3NvYStqyw4gjCIBCvUcQWqEZgCPtP onIIyX9RV4KJiOJJojgdV1vAjXypZWamOCSAELQzf30FTXjEcG9hFPUFkkMrTkJ8MMJ6 Iba57Nsdw3aM7l3IBSNd8NtYA5lZpY5D6vDJlq1AFzuiLUHIzq4IGINTMrhmgyDgDJh5 3bdiLqdJLu4q9tSgaZ0j/2gEMr2Xa6G+L4vUkE7QLezVoWg2dkG6Gnc+oXGby4bOTwv8 R26BRvaCpY0QE7jlLTp3ihnjQ7mptNzL2dQ505rZZr4xjFrOboQtV/muftffZv2M7fbR FXzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=5E8YooyCihFwVv7oYAz75wqjXHOAj38SOo/gntocg68=; b=Dj4133aWfrBEHeDAexihCpZa8dS/30px8n2ZLZpJp4tfy3oTiC+gq1qxF2A6J+M3vx QiDhCYH0ZJ+UAgZZ6UnkZhsv6tvA16ghzoCGmHqMzNRZZ3RbWA0XGqc5l25i0hYLJYmt 68DIl0GVAK8iAZe4iQhKMRhmoB0YnHGWIlQo8fi3CdetWKWlVe8snmy8YE3+TEZuzQ2d Gnx/9ci9Odmfa8Evycm4N6ROuRV4NsfQGl8H1uNIlNjmQdiBwPYys5GgzvCO1g6EHAxV z747QR+9lQ8tryMARmhA0CXPnuPj95E/O4jNWDfY5YqZ+u5CtTOhfCTxvg6GCCdlvJ/6 BXCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lMvKjfN4; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb44si6949771ejc.150.2020.11.18.06.25.11; Wed, 18 Nov 2020 06:25:11 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lMvKjfN4; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbgKROYm (ORCPT + 8 others); Wed, 18 Nov 2020 09:24:42 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:33238 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726314AbgKROYm (ORCPT ); Wed, 18 Nov 2020 09:24:42 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0AIEOY39102501; Wed, 18 Nov 2020 08:24:34 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1605709474; bh=5E8YooyCihFwVv7oYAz75wqjXHOAj38SOo/gntocg68=; h=From:To:CC:Subject:Date; b=lMvKjfN49o3TtzvgwmGjNNUFmVQAugLuksAFhXuy1lR/+SZpEUmUXjObZnxFDXZOE hBOttzFsSpY9hmbWW4KKjHYZF2RN+usr/+yiSIqq335ZEQT6zO4GSdhGILOujZiASL uODe44hJvb+ky2zsXcyKd8YxbzTNohXxLZpdHAWc= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AIEOYuf013451 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Nov 2020 08:24:34 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 18 Nov 2020 08:24:34 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 18 Nov 2020 08:24:34 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0AIEOXRv064321; Wed, 18 Nov 2020 08:24:33 -0600 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski , Andrew Lunn , Heiner Kallweit CC: , Grygorii Strashko Subject: [PATCH] mdio_bus: suppress err message for reset gpio EPROBE_DEFER Date: Wed, 18 Nov 2020 16:24:26 +0200 Message-ID: <20201118142426.25369-1-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The mdio_bus may have dependencies from GPIO controller and so got deferred. Now it will print error message every time -EPROBE_DEFER is returned from: __mdiobus_register() |-devm_gpiod_get_optional() without actually identifying error code. "mdio_bus 4a101000.mdio: mii_bus 4a101000.mdio couldn't get reset GPIO" Hence, suppress error message when devm_gpiod_get_optional() returning -EPROBE_DEFER case. Signed-off-by: Grygorii Strashko --- drivers/net/phy/mdio_bus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 757e950fb745..54fc13043656 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -546,10 +546,11 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) /* de-assert bus level PHY GPIO reset */ gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(gpiod)) { - dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n", - bus->id); + err = PTR_ERR(gpiod); + if (err != -EPROBE_DEFER) + dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO %d\n", bus->id, err); device_del(&bus->dev); - return PTR_ERR(gpiod); + return err; } else if (gpiod) { bus->reset_gpiod = gpiod;