Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp452996pxb; Thu, 19 Nov 2020 05:41:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+uiYFuq5vCLkUieSMIuhBA7eXqkgy4n0gSFeX9AWvocrP7tujp6B0nbcXL0ZmEpf6jipb X-Received: by 2002:aa7:c151:: with SMTP id r17mr30618268edp.216.1605793292388; Thu, 19 Nov 2020 05:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605793292; cv=none; d=google.com; s=arc-20160816; b=jtod5dHLlUAnG1ziu6FfOMVcqQetHH2trrpiC5rzqhawqd4z1h9THVfeV4MzLXtLny 4aF8mFOrCZ64RyVXWVB0JoW2oR3hUD5aZwfD+M6LJe/ErtJEUsSVC6kgoABwEwqOxPvy CGNPU81ziJzml8LnsiBsV8QtDlUHOknoOK3QnpXfoTUcMr3vAWJmcMSvOcOL1am6mOgr N7yWUBhWtyEvTWBciJwywWprBdoXg12KjyLsw+iIdLE+1aDIKaAfdPcZrwPA+ffDmFg+ +YxH99vghSRF3vrQNXbZ9RiTRFCbmiUQPRX16qW/HKKOgK6eiFXCyHVSwn3UyTgbKi8q MMjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=nHG4ole5ud6+/+q2v9aEYqrYVx8fqlP+wXkdMjeFNZA=; b=FUo3YxAPoP5U7sCqhAXZ4w/W90kLW8hO4HHJBOKsRCDHy8Fnrq5VSDIJ2e18pe1g+I XAYnAsaw9qq2GHILrjeq7xfzx1RNmFjuHQcLXODuitSqCyEM63itRfSoDKbVRWv5f/zv o7bsgXhnqI/AItxNlY1PoA98lHDXZVAtboKdWk+c51XzmmQk6ublNmobvgigp3ZXdzp2 lxLuV6ZDQi/vxy2VMblCLxrEshWBpkqJbYo2VxaWF6jfrLttCI0sqo/yf4XyzxtdTJtF GoE0JZLqHlrE0ynCLpEpTDBy63HSExKILqc3vMzFAECrbZBFM0AtMU2fZh2AY8e1USga iIsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="P/u19tPk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 j12si18964365edy.584.2020.11.19.05.41.04; Thu, 19 Nov 2020 05:41:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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="P/u19tPk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1727086AbgKSNii (ORCPT + 99 others); Thu, 19 Nov 2020 08:38:38 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:50916 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgKSNih (ORCPT ); Thu, 19 Nov 2020 08:38:37 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0AJDcTYr042372; Thu, 19 Nov 2020 07:38:29 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1605793109; bh=nHG4ole5ud6+/+q2v9aEYqrYVx8fqlP+wXkdMjeFNZA=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=P/u19tPkmGmf0S+O9VCaSKHmoovk35StxJoaLMTWGWiy1smaplz0CMJHZ6y/jVVYJ 4VlZFprH+ZzCxbSrzR4CQY3n3e6VImdEfZgMOMz+ftcakwlpR41gibWSbOW3jWvIXI 81+JM+YpqPb1tnyeHJ8/S4TzdEYUpTI0gkFIqGNc= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AJDcTjd034689 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 19 Nov 2020 07:38:29 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 19 Nov 2020 07:38:29 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE105.ent.ti.com (10.64.6.26) 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; Thu, 19 Nov 2020 07:38:29 -0600 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0AJDcRZx121192; Thu, 19 Nov 2020 07:38:27 -0600 Subject: Re: [PATCH] mdio_bus: suppress err message for reset gpio EPROBE_DEFER To: Heiner Kallweit , "David S. Miller" , , Jakub Kicinski , Andrew Lunn CC: References: <20201118142426.25369-1-grygorii.strashko@ti.com> <0329ed05-371b-0bb5-4f85-75ecaff6a70b@gmail.com> From: Grygorii Strashko Message-ID: <655ec6e4-6e75-1835-034c-ec18dac505e8@ti.com> Date: Thu, 19 Nov 2020 15:38:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <0329ed05-371b-0bb5-4f85-75ecaff6a70b@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/11/2020 14:30, Heiner Kallweit wrote: > Am 18.11.2020 um 15:24 schrieb Grygorii Strashko: >> 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(-) >> >> 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; >> >> > > Using dev_err_probe() here would simplify the code. > this was my first though, but was not sure if it's correct as dev_err_probe() will use dev to store defer reason, but the same 'dev' is deleted on the next line. I also thought about using bus->parent, but it's not always provided. So, if you think dev_err_probe(0) can be used - I can change and re-send. -- Best regards, grygorii