From patchwork Thu Jun 29 19:14:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 114421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9882155vqr; Thu, 29 Jun 2023 13:06:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmwCy9zpb9LKwd/P6KeTL4MLDdhP7+psnZ64wqmH3kkNL1hNEOHaHZH4oZ0+Imdz1iDkQF X-Received: by 2002:a17:90a:1a1c:b0:263:341:6141 with SMTP id 28-20020a17090a1a1c00b0026303416141mr1067823pjk.3.1688069164269; Thu, 29 Jun 2023 13:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688069164; cv=none; d=google.com; s=arc-20160816; b=k7ls27KkEPNmfHk84dFXiKPeavfbrdLeJFssB2hc+PheQ2wnkDRwOqVoN4/wSgMI1u fqph7guoL11WfLUaphWVctvgRhnQpqnA0INF1skRXBr0hCdtyWaSo/g/OTcUmp7W4e6G PKAVH54/Q9FOsRCZBjkVN8srjBgKeq/3s1ek88xURCzvY/+V5mEAO/9JAK/C+rW9le6w R7Zz0Hc+j/SP2B5QdcbruMbbZ72YgoQJdYf9q1NDI4qY3Iz7ouN0zo9TSBpBZQDsTpjr EcusKwnNAvaKrC0mXqkmNDcIu4wfQ+9hmDGowS8AtF1bJjsVH3pyIURXYAWipa5Zqi35 m0eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CB4F2eDO1VL92Q0HqzTksbw7n9fujtKb1FZPPsN/d0c=; fh=Cww3/v7hgOcQRe7G5cjCIDImBv5D9tzrE0C8d4F5whg=; b=BjKCQFGVooguBbG4q+i489kXUMSPIvNVFK+GS5uXN1yqLPAQi+FyNFJz4mC9YNPHBR iNwVYbNy/YcHDf/a3Xc4/GW0x4RvOLTGYM3r2qusSH2UypgnZf4iryKIhtBHMBeFRkdZ kPVc9RYDf/Zm2/syX7gLRp8CI/CKG9ICDxMtdO7YjjhC1l9Lj5Iq9lEDwbU78hDVXQPW ZjDJj7nNHrMPIlAWmART3OGK9VQ+hHQFpprcNybR4EpCFEdrnSPcyhbQR3dFY/2VgP6y KWPJjsOCz+oRO37DV/a33iHQoyBtzb0d0ECK5ALWXmQZ+X3ZgEAnzHrvXRBan1yTZgMf 09uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BqpD4ZwM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a631f06000000b005348b4f79f1si11236147pgf.345.2023.06.29.13.05.48; Thu, 29 Jun 2023 13:06:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BqpD4ZwM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232186AbjF2TVP (ORCPT + 99 others); Thu, 29 Jun 2023 15:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233247AbjF2TU3 (ORCPT ); Thu, 29 Jun 2023 15:20:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70DD9468C for ; Thu, 29 Jun 2023 12:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688066268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CB4F2eDO1VL92Q0HqzTksbw7n9fujtKb1FZPPsN/d0c=; b=BqpD4ZwMzYZmpIJ45DfkxUtfb6EFY/wUovblgtb4/RWR9jwNEyvj2jNzIpKyYnEZETM4sQ 6Y1Zn0/78sSfVelNKxLcfN24j4Pbo1Bvo8oXo1fbYvpJy8nm0mxVf+YpQ6k54PNHJvwA7G kMonJ0IdMCIJic14np/lWmUqJ+sIpQk= Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-nTksXX5HPguh-8DvuPeldA-1; Thu, 29 Jun 2023 15:17:47 -0400 X-MC-Unique: nTksXX5HPguh-8DvuPeldA-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-57704a25be9so15581197b3.1 for ; Thu, 29 Jun 2023 12:17:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688066266; x=1690658266; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CB4F2eDO1VL92Q0HqzTksbw7n9fujtKb1FZPPsN/d0c=; b=EVLphCcdbCznSz6F6q339m0jnZADRZCmjz+glmkJNxutxWic0TzscBuuN3cOq5OujG rXMnlBj5c0G1vK3QGaK9oqKBE1Ga6xT/w0NRKMi1uhWIELhTwM+3cRitsnMpk/Kevqmk q8gmmkw8/95YQYao6BUiFnmVfFuaKnf36//I5GTnoC2rCN9VUSMHmHHD/t7czWiLjYYr iKdUYaye43ujap7vZbDALkFCkk9sleQkryBRRf5InsUPB57q1rNoo1oRjdWljo2lBvsp mLQrqLsFV04k6gQEvzb4GPxTfDgKcXJKLXMyh84e7e/LTN/8qGgD6ZY7G/5J8mF2JeNn bhGQ== X-Gm-Message-State: ABy/qLaPTYKBVkHKMSYjUgdjzwBh0k4bxsdn3s1D8JaEEwTJEe0IMrFL GHw1GY8S6RZiAKwJDnqBKhvdaAzGIO9PXZlwEPQL6GTLhhCwjcY41j8kBIlB/0HKS7da8DyCqGd fI4VLH4kBhJOmgmXO5QCxv5b3NCKPYe66pdw27cQo4PoMbZ9muRmDCF8Np/Bn3aK/xPrT9uVvS2 H7mJeZRPO6 X-Received: by 2002:a81:a04a:0:b0:56c:e260:e2d5 with SMTP id x71-20020a81a04a000000b0056ce260e2d5mr6808628ywg.7.1688066266357; Thu, 29 Jun 2023 12:17:46 -0700 (PDT) X-Received: by 2002:a81:a04a:0:b0:56c:e260:e2d5 with SMTP id x71-20020a81a04a000000b0056ce260e2d5mr6808604ywg.7.1688066266038; Thu, 29 Jun 2023 12:17:46 -0700 (PDT) Received: from halaney-x13s.redhat.com ([2600:1700:1ff0:d0e0::22]) by smtp.gmail.com with ESMTPSA id w127-20020a0ded85000000b0057085b18cddsm3052478ywe.54.2023.06.29.12.17.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 12:17:45 -0700 (PDT) From: Andrew Halaney To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org, mcoquelin.stm32@gmail.com, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, joabreu@synopsys.com, alexandre.torgue@foss.st.com, peppe.cavallaro@st.com, bhupesh.sharma@linaro.org, vkoul@kernel.org, bartosz.golaszewski@linaro.org, Andrew Halaney Subject: [PATCH 1/3] net: stmmac: dwmac-qcom-ethqos: Return device_get_phy_mode() errors properly Date: Thu, 29 Jun 2023 14:14:16 -0500 Message-ID: <20230629191725.1434142-1-ahalaney@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770067395882309818?= X-GMAIL-MSGID: =?utf-8?q?1770068812199178747?= Other than -ENODEV, other errors resulted in -EINVAL being returned instead of the actual error. Signed-off-by: Andrew Halaney --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index e62940414e54..3bf025e8e2bd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -721,6 +721,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) return -ENOMEM; ethqos->phy_mode = device_get_phy_mode(dev); + if (ethqos->phy_mode < 0) + return dev_err_probe(dev, ethqos->phy_mode, + "Failed to get phy mode\n"); switch (ethqos->phy_mode) { case PHY_INTERFACE_MODE_RGMII: case PHY_INTERFACE_MODE_RGMII_ID: @@ -731,8 +734,6 @@ static int qcom_ethqos_probe(struct platform_device *pdev) case PHY_INTERFACE_MODE_SGMII: ethqos->configure_func = ethqos_configure_sgmii; break; - case -ENODEV: - return -ENODEV; default: return -EINVAL; } From patchwork Thu Jun 29 19:14:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 114400 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9873308vqr; Thu, 29 Jun 2023 12:50:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJiqK63PiNx+NLL6VFQfuCR5WWbzxWXcH+wrAgc5bzNGIOoGR90+p02B72f61W+HXuWVUl X-Received: by 2002:a17:902:700c:b0:1b6:89bf:4db7 with SMTP id y12-20020a170902700c00b001b689bf4db7mr104499plk.69.1688068211118; Thu, 29 Jun 2023 12:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688068211; cv=none; d=google.com; s=arc-20160816; b=u9OM1DfdG1d7tlWAsojpouBEZ8dHNPdkR2/fOaSW6oButaiI2mkkjktMypxi8Sw1hX FOewYCkigNyNKk+5GVzYlM5huDeXS7F34A+uoZcYzZUGlF49Hktf/MRmt3N+UrTmQzpp Y1PRvtnwwO0FfMTzxE2w6B/Cv8g5PzE4FSQPdXjhhF9F3kYJJCQGkBeHVANi55Ee+s8V QwFxfps1U3rKZKgmulvUnBsPulhUegRHICshI+w8CjrYKiZ1w+Bm1N9T1RLBkmVBp5u8 M49aP/VMr9menatUsdWy1oz+jzHN2GUlHP2P/+CmQmGyF3/Xy/2IopcbNxYTwJkes5X/ NKXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IdunTKBXq26vcyYb/EdIVE7YvQRq/YPpQ2jK2C3l7sY=; fh=Cww3/v7hgOcQRe7G5cjCIDImBv5D9tzrE0C8d4F5whg=; b=RpLkbcKipP7XDBSFeHi5tNVwB0DbMdV2QCkem9c8VElFvMB9XejHLNSNHqhmUgX3wJ 6ASMoL5LwpRh7M0A9XwO1xUPMgzGNRmZySvUDKdzJJHkJaX7Vqu4660Rh5njVFkFs2Sg UvBsbEr75sf+jJRXXewd21nqLOWORSIhYGUFchJE9+6UlZ3cUGHRg4jBgLkXI4Twuq4N rKLNOr70y5nFC8sAmtcZUSvuyf1iRZwFaTVEy2wUEs39Fakp9D6LxKYr92uOFLL+1Hbr n6KvTCFVRQyFOnRBfqSHgdWbH24ipzPy1HvH8bDszT/muaNYrjuDNakI0nFZRRFg6shD xGMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VDKZKcCO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a170902f1d300b001b86492d71bsi708194plc.562.2023.06.29.12.49.55; Thu, 29 Jun 2023 12:50:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VDKZKcCO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231888AbjF2TVK (ORCPT + 99 others); Thu, 29 Jun 2023 15:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233262AbjF2TUb (ORCPT ); Thu, 29 Jun 2023 15:20:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 286364699 for ; Thu, 29 Jun 2023 12:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688066281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IdunTKBXq26vcyYb/EdIVE7YvQRq/YPpQ2jK2C3l7sY=; b=VDKZKcCOjBHpSiu9M3ndPRoUf5k29rXGq/BfARQ3Kk4OKNMGKt6J37KoiLJmUPO8iLsNVm ckdnwwfPZG2rdpcxS48stHIBtDITT1qTPPXhThKknvBxu6UT/PsDBdNJ/FPx6V+VUJs/zj geler9EUkkpgieB6tBcjuLqXS+x2dA8= Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-359-Pb9xJYt-N4WowBIJOhIpXQ-1; Thu, 29 Jun 2023 15:17:59 -0400 X-MC-Unique: Pb9xJYt-N4WowBIJOhIpXQ-1 Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-5704e551e8bso8704337b3.3 for ; Thu, 29 Jun 2023 12:17:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688066278; x=1690658278; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IdunTKBXq26vcyYb/EdIVE7YvQRq/YPpQ2jK2C3l7sY=; b=OfrV56eDa+Y18mgCy3i2ywPs/vaD3kEjkPXDzvgt0JmehyWAarFrQEVhKJSkzivPBG yINpCogDCD26Kb9kwiiz1Gx7B3OS2ZlEKIMQLxLnfpCfBTry9fbXvmRo7ZVHQsppZMqV 2OMyewrBua/WzdATV5G8lHt3E3PPgO0DIEBOBdxg7a0whSf4BpU7ip2XsaSUxTpccqly /IuOBu6uXrvKu/LQT5FFQcJuj8A9HipP/7gZR+3AEOJm6TVu8qhT0WjMneMnasv5Evbd OAosqCbarKfxUW7wfSV6JUTVTBSCUtjfAG6+V2EOMuRtOZTNFwlbwF5ScIjLjlfNIryB pI1A== X-Gm-Message-State: ABy/qLYZes+rzYAJaHV7GTjzhz0OKmI3sHD/Ydj2KYJvl0XMKVigX+8o Flw/cpOhehEnjnx3C4PpXE3nDdL3lKTvlpH9alM2G7fTW1MMS4/e7aEOqAprmvJi6lkDccIFsYr v8Jf5/jY4qaZn0dUdgOyt7jjDlMHJPIrEtzUzsyGqH3LCq4kBfgCB7d8rJ/pO99aEhy0sfeG9/1 Tdb4l7CE3w X-Received: by 2002:a0d:f2c4:0:b0:570:6fbd:2daf with SMTP id b187-20020a0df2c4000000b005706fbd2dafmr303082ywf.37.1688066278500; Thu, 29 Jun 2023 12:17:58 -0700 (PDT) X-Received: by 2002:a0d:f2c4:0:b0:570:6fbd:2daf with SMTP id b187-20020a0df2c4000000b005706fbd2dafmr303048ywf.37.1688066278207; Thu, 29 Jun 2023 12:17:58 -0700 (PDT) Received: from halaney-x13s.redhat.com ([2600:1700:1ff0:d0e0::22]) by smtp.gmail.com with ESMTPSA id w127-20020a0ded85000000b0057085b18cddsm3052478ywe.54.2023.06.29.12.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 12:17:57 -0700 (PDT) From: Andrew Halaney To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org, mcoquelin.stm32@gmail.com, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, joabreu@synopsys.com, alexandre.torgue@foss.st.com, peppe.cavallaro@st.com, bhupesh.sharma@linaro.org, vkoul@kernel.org, bartosz.golaszewski@linaro.org, Andrew Halaney Subject: [PATCH 2/3] net: stmmac: dwmac-qcom-ethqos: Use dev_err_probe() Date: Thu, 29 Jun 2023 14:14:17 -0500 Message-ID: <20230629191725.1434142-2-ahalaney@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230629191725.1434142-1-ahalaney@redhat.com> References: <20230629191725.1434142-1-ahalaney@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770067812219176918?= X-GMAIL-MSGID: =?utf-8?q?1770067812219176918?= Using dev_err_probe() logs to devices_deferred which is helpful when debugging. Signed-off-by: Andrew Halaney Reviewed-by: Andrew Lunn --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 3bf025e8e2bd..a40869b2dd64 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -710,8 +710,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); if (IS_ERR(plat_dat)) { - dev_err(dev, "dt configuration failed\n"); - return PTR_ERR(plat_dat); + return dev_err_probe(dev, PTR_ERR(plat_dat), + "dt configuration failed\n"); } plat_dat->clks_config = ethqos_clks_config; From patchwork Thu Jun 29 19:14:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 114427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9895477vqr; Thu, 29 Jun 2023 13:30:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NbYNlBCgUq9p7yW61iloMOvzGUvouqyBJRKCfFNgT0sBMcInDzngjNuYRB6mdkh7ypcYa X-Received: by 2002:a05:6a20:244a:b0:110:5141:dc8d with SMTP id t10-20020a056a20244a00b001105141dc8dmr796302pzc.25.1688070652076; Thu, 29 Jun 2023 13:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688070652; cv=none; d=google.com; s=arc-20160816; b=JPS1LhJfjRsly8oo8eiXay061yvjvmyz6i+2BkLY8rROQ85rg5La1EZlma75UcmHRb vpgE9w2R2+qWNgm99G7EWHrP62/KLnzPLLiobgZRm1mgoNrnnEWAXNEKYvnEjiWhVu/P NVNOx24rMhBButpqcKcJBLbuqO00glebUqhj/RVqZoBUj3rMmmP1kEPedf++WW/MDxmF myfpJJfyfLnouyhcyJnF3vAWb0+Mf61YGx+2Gtz3AKmWzSw7K9rDxnoxK0MBOEi4uSYd 6QNEA2yY/uqOOth/nkJD/n9h1xpEHshouia1BUSA1awLrmsC6BU+r4Z0MYVUYkerrmj1 Hs2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YCceMk07Z77c7iGv0vMNdhiFvW89N91YRXanb/xg6cQ=; fh=Cww3/v7hgOcQRe7G5cjCIDImBv5D9tzrE0C8d4F5whg=; b=hhsTRGKreugziofr1xOzy9J6GKDl58X8hDgtyJUA4OMbjhjD0nfadWu84iG17g+VsW Az7p3luRJj/vjOdexfmhlADFuxqx68ezjP+eyALia8ldGaR08Y/0H5hOrismMOI2IoYv MBhI2vhzT/WO2MCvYf7NnG/19TB+XkgkvXN5DLGkNA/7ys4QYyGbZ5JCxQsN0xBPZgFD pHzen5869trN23Ed/crIu33ZJr3o/nBwTT/IR1wNZVCOEqz/7zYAZ90I+lrPmu4fSWC+ zWiMVXKLsyvtc+Ikp3OMKB9w3kWgF2RtKdQOwr3KeMAFGwy4wAlpgP36USZwiBYCVyxF DJ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="dbw/GRy/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t63-20020a632d42000000b005577906618csi10980521pgt.532.2023.06.29.13.30.38; Thu, 29 Jun 2023 13:30:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="dbw/GRy/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbjF2TVE (ORCPT + 99 others); Thu, 29 Jun 2023 15:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233294AbjF2TUh (ORCPT ); Thu, 29 Jun 2023 15:20:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6214B46B4 for ; Thu, 29 Jun 2023 12:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688066286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YCceMk07Z77c7iGv0vMNdhiFvW89N91YRXanb/xg6cQ=; b=dbw/GRy/ppvpcrIJA+UvpmnK6mnlb3nyXjJWy7e6uWDAFlLPO/XIM16tbm5SXUYXyFFOmn TBBFNM4TzRt6BKcGc1ChNB/JAIdEvmp+rG2lX8wWDwo3+X2pl6hrSM5bhMRvGq6PYXOExJ KPbx5OtuIfrADZPNfOSvF5hIjLIDYWw= Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-421-6s4JwX4JN4u7aREQZS0Slg-1; Thu, 29 Jun 2023 15:18:05 -0400 X-MC-Unique: 6s4JwX4JN4u7aREQZS0Slg-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-56942442eb0so8801007b3.1 for ; Thu, 29 Jun 2023 12:18:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688066284; x=1690658284; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YCceMk07Z77c7iGv0vMNdhiFvW89N91YRXanb/xg6cQ=; b=As3/7n9KNVR9Vw3WPzleRjgaIQalQCNwg0hY6l1A8j6L5hCnLdCLm1al+q4K61DXlQ MBJELHiU4sEugQvVx/6S63l3MWQr00H3ZH6U0StbM7L0jHPpJcQZ8T6SEQYylGCo0V2x NuQJBBTcQYcz4dv+aglBvFbFFNFcDTBH7aogjhyACLFFhf9FW7tnIRv8S//p2UIHPKGc VkvG1tc5OMp4nVePsEsOS5nGh1avqsVs/aANEN3vaILIyJIZw5pKosBwEvP/66ErrqzV lTAzHD1rVYxgjBDkIwrHIyTu5nHkS1+oW+PAuEGlmTYx0Ss2DeGU6wWs0ICLQnvfuFId XQIw== X-Gm-Message-State: ABy/qLaXjOKToy0HX7gMjuY8eEF8iIIvetrK+L4f9rGfV8MNjYPYc8r5 eLmn48RkJG2xLcWwyNaD3iOIv3JGZ07mUmaCWAnm/55uzagJ05ncHflQSXQVwDsxGc29DnGmjFW hjnmJw7UAJPP1JY3P7XvSvJbLe6lM/NT594GqwRhjp7MFYZIPQ+EsINdywMRkmhkDt4CONH7wIj P9aixfXPVb X-Received: by 2002:a81:88c7:0:b0:56d:43bd:5513 with SMTP id y190-20020a8188c7000000b0056d43bd5513mr352228ywf.5.1688066284438; Thu, 29 Jun 2023 12:18:04 -0700 (PDT) X-Received: by 2002:a81:88c7:0:b0:56d:43bd:5513 with SMTP id y190-20020a8188c7000000b0056d43bd5513mr352198ywf.5.1688066284148; Thu, 29 Jun 2023 12:18:04 -0700 (PDT) Received: from halaney-x13s.redhat.com ([2600:1700:1ff0:d0e0::22]) by smtp.gmail.com with ESMTPSA id w127-20020a0ded85000000b0057085b18cddsm3052478ywe.54.2023.06.29.12.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 12:18:03 -0700 (PDT) From: Andrew Halaney To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org, mcoquelin.stm32@gmail.com, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, joabreu@synopsys.com, alexandre.torgue@foss.st.com, peppe.cavallaro@st.com, bhupesh.sharma@linaro.org, vkoul@kernel.org, bartosz.golaszewski@linaro.org, Andrew Halaney Subject: [PATCH 3/3] net: stmmac: dwmac-qcom-ethqos: Log more errors in probe Date: Thu, 29 Jun 2023 14:14:18 -0500 Message-ID: <20230629191725.1434142-3-ahalaney@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230629191725.1434142-1-ahalaney@redhat.com> References: <20230629191725.1434142-1-ahalaney@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770070372274314483?= X-GMAIL-MSGID: =?utf-8?q?1770070372274314483?= These are useful to see when debugging a probe failure. Signed-off-by: Andrew Halaney --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index a40869b2dd64..d792b7dd9fc3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -706,7 +706,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ret = stmmac_get_platform_resources(pdev, &stmmac_res); if (ret) - return ret; + return dev_err_probe(dev, ret, + "Failed to get platform resources\n"); plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); if (IS_ERR(plat_dat)) { @@ -735,13 +736,16 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->configure_func = ethqos_configure_sgmii; break; default: + dev_err(dev, "Unsupported phy mode %s\n", + phy_modes(ethqos->phy_mode)); return -EINVAL; } ethqos->pdev = pdev; ethqos->rgmii_base = devm_platform_ioremap_resource_byname(pdev, "rgmii"); if (IS_ERR(ethqos->rgmii_base)) - return PTR_ERR(ethqos->rgmii_base); + return dev_err_probe(dev, PTR_ERR(ethqos->rgmii_base), + "Failed to map rgmii resource\n"); ethqos->mac_base = stmmac_res.addr; @@ -753,7 +757,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->link_clk = devm_clk_get(dev, data->link_clk_name ?: "rgmii"); if (IS_ERR(ethqos->link_clk)) - return PTR_ERR(ethqos->link_clk); + return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), + "Failed to get link_clk\n"); ret = ethqos_clks_config(ethqos, true); if (ret) @@ -765,7 +770,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->serdes_phy = devm_phy_optional_get(dev, "serdes"); if (IS_ERR(ethqos->serdes_phy)) - return PTR_ERR(ethqos->serdes_phy); + return dev_err_probe(dev, PTR_ERR(ethqos->serdes_phy), + "Failed to get serdes phy\n"); ethqos->speed = SPEED_1000; ethqos_update_link_clk(ethqos, SPEED_1000);