From mboxrd@z Thu Jan 1 00:00:00 1970 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 A2B78EB64D9 for ; Thu, 29 Jun 2023 20:29:27 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kHJkzwq3zcWXfxeazB/M5dPHyPVypLt5H+0+Tff8Pag=; b=iDpKcpM6fzQgDv Rj92PLMqCo9QttZgPWKdiIp74HaJlcjPWFm2RrjaAQv8Ic5c4c/cINeyW7GG+x2PM3burX7313unW 5YIu5WYDuiYhMx6ZgyDJ2AlZT9PbtcpJJYwgaT9WBn7XswakQ0BTYEuJpFofv4i3cX2KGiRtW0FTn Kutyph/cqg3Sq95CpjFA/4rTksuNRWfxNdj/8ZLy23o50ZyVhSjjPP9vLkUv7ZMlqqSrPSiLVMSGz eaH/rc0HHMv6rf4TsEWOJY2RCx931jopIxITK1pN+NzwoRJ2JRM+OWwEgaUVQ/ONBuG8WQqI+Yshr EWGIUqjEJNUl/W4lDUBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEyG5-0024vS-0m; Thu, 29 Jun 2023 20:28:53 +0000 Received: from vps0.lunn.ch ([156.67.10.101]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEyG2-0024uU-1S for linux-arm-kernel@lists.infradead.org; Thu, 29 Jun 2023 20:28:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=JJTXlY6wtDO/dgQsOAsZ3Cbbd06wnHj1OxnXQLvZ2zI=; b=haFASrG5nuBS3YS6DPaEq5i3eU iG8shjOJk5clS1phTvX2/t7l5yi8/7S7fEGgWWP4cXtyjngzHPC58j6Wme6xu5g8PybcnmI0MinKg WgLr1Q62+MO60OcPMn6wOWP37Yo6Lo5Q1HFuUHsERfvn68mc6VHjMW+yrccNUntQAKJw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qEyFu-000FjX-2B; Thu, 29 Jun 2023 22:28:42 +0200 Date: Thu, 29 Jun 2023 22:28:42 +0200 From: Andrew Lunn To: Andrew Halaney Cc: linux-kernel@vger.kernel.org, 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 Subject: Re: [PATCH 1/3] net: stmmac: dwmac-qcom-ethqos: Return device_get_phy_mode() errors properly Message-ID: <5b46e92f-0f32-46f2-85ef-94f7c6a7ca9f@lunn.ch> References: <20230629191725.1434142-1-ahalaney@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230629191725.1434142-1-ahalaney@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230629_132850_506935_6E066FEB X-CRM114-Status: GOOD ( 17.07 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 29, 2023 at 02:14:16PM -0500, Andrew Halaney wrote: > 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"); If this every used on anything other than device tree? of_get_phy_mode() has a better API, there is a clear separation of the return value indicating success/fail, and the interface mode found in DT. You can then change phy_mode in struct qcom_ethqos to be phy_interface_t. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel