From patchwork Mon Jul 10 20:06:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13307576 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 7132EEB64DA for ; Mon, 10 Jul 2023 20:18:08 +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:References:In-Reply-To: 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: List-Owner; bh=76apJXlPXeMUpckUyOax0IkWq5BbjJl/raZgMogNa08=; b=cRwdte9iiQTWyM cfJ+/OIYy5cERUdVGTNK0BTFeLIx7jjvvtD/HbrMLIG1K844k9VhAVw/jcpmK7+kzkssbCJdOuBgd B3+ZcrRAhTR+Fhx4/SfeaxSZDGUmNmFVk581PhCfOoda1A7oGsf5FrbplT2tZ6/gC61RTYgFKwOhu mlKUmRkJePIKr0qA0EEbiiN9oi18StL2/QmRFW2MPQYxoqwTD7gHQsp+1/otTQfEQ2nOFZT87QIsH 27AFftr//J+6IgP7qwnJNnkEQlOV1LMoDE3MXmKHYeNfId0vSNmmMuyjOc3DJ+aZEtYG2zGmvAHRN WircpbdOweDmi4IJRSYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qIxKF-00Cdxs-2q; Mon, 10 Jul 2023 20:17:39 +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 1qIxKD-00CdxD-0n for linux-arm-kernel@lists.infradead.org; Mon, 10 Jul 2023 20:17:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689020256; 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=YmlAnwDpnt7QnZH9R1+eVRqHntPGLtyJNksmlK12GAU=; b=EOkQN6twhZrgUcYmbPrfnWduq5z+Beqp4QwpmPbVKca1sFR4o28fzHL8eHxF3lo2/wWoK+ Yr5bkI4ILbZg0t8YecAngOG5aphu/vvbZfDk0AVYcn3ozYeSLIDNEHb4sZUzYBhVcI6Cud O7A+BHxx7H4rlgWAxaE0CA7Wvq2xU4o= Received: from mail-oa1-f69.google.com (mail-oa1-f69.google.com [209.85.160.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-1kZc7JKVN5aiyImA5dqMTQ-1; Mon, 10 Jul 2023 16:17:35 -0400 X-MC-Unique: 1kZc7JKVN5aiyImA5dqMTQ-1 Received: by mail-oa1-f69.google.com with SMTP id 586e51a60fabf-1b437eacd10so4563850fac.3 for ; Mon, 10 Jul 2023 13:17:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689020254; x=1691612254; 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=YmlAnwDpnt7QnZH9R1+eVRqHntPGLtyJNksmlK12GAU=; b=L/q5prWZa/CuAwHRFbPx7NfSJz9Y80XA29sappSeR+wqXYehvH9BxB8JzWwCU8cU1r j3GMGZh93s1cJWnnm4QahqQFLPetIdvrowtq4PicBgWUmGvPu6tQpY5itNnMEmlNiuWr 4Kd5WEbsbAgHEZjU3te5r4oz+feza2Urseg67P1ueNV/nxB0tfAYYJISCZDlQl5GycXM HehhPlznczQWu+zozaGFVyqWa1HbIyb393MtRjO0J2K0pSnO8hH+VDWDvsm6H1wonAqe bR+zcneoMZpkWy2AelLakmojuKtAdUb0WTMJ/+LpGDoO3tXXG4q5Xu8HkL55/97eHXmX ND6w== X-Gm-Message-State: ABy/qLbrwhHefdVj1OLFVP7WzL3JTYW93xij6YQ4QBLhsK2covMFmDRn kgb4/A4zQJ5k66dpPzfe1riOy4fGFmOI3z4/8cMpZKY7iuom1Kxjzmp+FlMBwFQM2VYASlda7dl 2yae4ByhI3mRz2CTYhtjJ0/OBD7GuFVK2q6U= X-Received: by 2002:a05:6870:5254:b0:1b0:4fc5:2e4b with SMTP id o20-20020a056870525400b001b04fc52e4bmr13438905oai.9.1689020254688; Mon, 10 Jul 2023 13:17:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmKqPEtPtyW1H2DGn/G9uxqGi6UQiom7uSU/SpIgU9Y6/TP9FG19pTfynkVg73dr92H4bGyw== X-Received: by 2002:a05:6870:5254:b0:1b0:4fc5:2e4b with SMTP id o20-20020a056870525400b001b04fc52e4bmr13438882oai.9.1689020254461; Mon, 10 Jul 2023 13:17:34 -0700 (PDT) Received: from halaney-x13s.attlocal.net ([2600:1700:1ff0:d0e0::22]) by smtp.gmail.com with ESMTPSA id j12-20020a81920c000000b0056d2a19ad91sm155097ywg.103.2023.07.10.13.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 13:17:34 -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, linux-arm-msm@vger.kernel.org, andrew@lunn.ch, simon.horman@corigine.com, Andrew Halaney Subject: [PATCH net-next v2 1/3] net: stmmac: dwmac-qcom-ethqos: Use of_get_phy_mode() over device_get_phy_mode() Date: Mon, 10 Jul 2023 15:06:37 -0500 Message-ID: <20230710201636.200412-2-ahalaney@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230710201636.200412-1-ahalaney@redhat.com> References: <20230710201636.200412-1-ahalaney@redhat.com> 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-20230710_131737_356890_5D8C13D9 X-CRM114-Status: GOOD ( 15.06 ) 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 Since this driver only uses devicetree, let's move over to of_get_phy_mode(). That API has an explicit error return and produces a phy_interface_t directly instead of an int when representing the phy mode. Signed-off-by: Andrew Halaney Reviewed-by: Andrew Lunn --- Changes since v1: * Convert to using of_get_phy_mode() instead of continuing to use device_get_phy_mode() (Andrew Lunn) .../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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..ebafdadb28d5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -4,10 +4,10 @@ #include #include #include +#include #include #include #include -#include #include "stmmac.h" #include "stmmac_platform.h" @@ -104,7 +104,7 @@ struct qcom_ethqos { struct clk *link_clk; struct phy *serdes_phy; unsigned int speed; - int phy_mode; + phy_interface_t phy_mode; const struct ethqos_emac_por *por; unsigned int num_por; @@ -720,7 +720,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (!ethqos) return -ENOMEM; - ethqos->phy_mode = device_get_phy_mode(dev); + ret = of_get_phy_mode(np, ðqos->phy_mode); + if (ret) + return dev_err_probe(dev, ret, "Failed to get phy mode\n"); switch (ethqos->phy_mode) { case PHY_INTERFACE_MODE_RGMII: case PHY_INTERFACE_MODE_RGMII_ID: @@ -731,8 +733,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; }