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: 13297225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AF3AEB64DD for ; Thu, 29 Jun 2023 19:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZzRBVAviPmXqQ1f6/MZzvSZs9WSqA8ekpvwIX9ejpt0=; b=XTOZ8zXdMezxGc ei7DdlXJpgPVrEf6x5qF5P271R+LuH8TkC7rpx03EHeXq0vVxfyKowW0tIEXNWb8EU/dmrEKhQGBZ NC8nO3wuJ42jci0CUHj3f3JGukJVAYV6KWlGuLg0JpTs163yTMgmqMNvq0dwTVZmzrI/btJyrT6E9 2HwpdJu2bMY/ar4nFuSBHabbvAt2JnIZhZjdou43QdAVxAKHwu4Of3lJlLqAMyYunT53UQ5fOXHNK PhieUsEvo1c/1dLLCG8DysT2R/Gd4fp22s0cTDHRCIvJtlDoMZzg/qx1hTB+PswLNUztFUpYlA2qQ ZSMpQ6M7sPyN+cKRnhWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEx9P-001uTk-20; Thu, 29 Jun 2023 19:17:55 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEx9M-001uSn-02 for linux-arm-kernel@lists.infradead.org; Thu, 29 Jun 2023 19:17:54 +0000 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-594-dV4O4jRiMQuqz8E1UzBMHQ-1; Thu, 29 Jun 2023 15:17:46 -0400 X-MC-Unique: dV4O4jRiMQuqz8E1UzBMHQ-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-57059e6f9c7so15764787b3.0 for ; Thu, 29 Jun 2023 12:17:46 -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=XRw2CqwA4f9Gga9uB9FyJNrnYrdd2h9xoxgKZKTOUTuDtuDpZvas/KIKsCi2lKqOJ4 L+0murwOiou5WAZKNvKrHoUJvVUSAdVLI0T+VK8sFB4HL0WGl+6iHfAVj4dflPWf4wPc ECcuBuyh2Davla2CvwnshWnWmKo3O3koBECaLyNrTyyvNPmDQXxiyj3cEKcWj1SqxTUq jDR1JfygglydLnBcEKJDQGkBfIATStTr6nl/02LNEqORq8ghD0sNOiLrI3Xkm2E4mBS0 u/Pz/2T2hHKFiUaXy9pwtpkwjo92NNfzHgwDYQLeBt50pBaDuYrqJ0tZWDZIzn8SedwM 2pGA== X-Gm-Message-State: ABy/qLbI+X/NnK6wWdwOSo2f44ORaB86w72GO7gXASBKvxCC3bhFmk/1 aQjZVl5wYrXRm6+8en/ZbkiROQ8PRyrbQY/T+2cn+sRqEZD8vWQRLaStWGHeZFIQ5FSF5272+hS vAPJE9OOv6gOOv654fse7GFPtUrxpo7XO2Pc= X-Received: by 2002:a81:a04a:0:b0:56c:e260:e2d5 with SMTP id x71-20020a81a04a000000b0056ce260e2d5mr6808626ywg.7.1688066266285; Thu, 29 Jun 2023 12:17:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHOfhrwZ9iRh4ReGxdsfikEqHuYNT4UdGjpezi+NU1/qUuJa+z/QJduR3WvMUh9O98fjlkVHg== 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230629_121752_141877_E5101D1F X-CRM114-Status: GOOD ( 11.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; }