From nobody Mon Feb 9 23:15:17 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73AB82FB0AB for ; Wed, 22 Oct 2025 07:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761118725; cv=none; b=CVOY0RkprbucVIYZiRs81zj7ftjTAJLJYuUJSl8HCXZo6CWLDO/ESdBkWe2SjYXJ9znb2eMCRepz1+FwxfQs2uqvuG0etvYHivvz0M4zVX/MZyinSlr8gMv2NUYaF06MvJPMQsZIy7Em1OqLpTrRQDdWaEz1wzY75Kiw7JCmPas= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761118725; c=relaxed/simple; bh=ms+zag/7r86CQCaiWGC3Z7UhMgu68ikR+Dwj2ZuEZqM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aDq8HMGGVfhXfpnyS3As9rk0Bnvmi6qXDb7OkdURnYMxzO8bDyG8WI6Karr9eEjDLk0vt1aC0SOQmbQ19MDYkfXbBggH3bIdn547ZUKZfoZz5Sf380hKIKloYFWPeBcTnZVSh+DrG+aUh++/YMxed0G2Mr4Mw4Z42qOn8Xc9d0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=HBHYBaf2; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="HBHYBaf2" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id F25A04E41268; Wed, 22 Oct 2025 07:38:41 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C8660606DC; Wed, 22 Oct 2025 07:38:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6EA9E102F2429; Wed, 22 Oct 2025 09:38:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761118720; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=iWvier8kbhkxAYenRkU9MVIUo2xMenGSI7RehQ0Iej8=; b=HBHYBaf2G9IaB4TLV+C49g9WIjnm7bSDZQeQjaIDPNF8UgxRwtsaXhnxApNRGC4/wyJbI1 pWqow1HzZaDxrSgSQbAFI6dLG3iXR0NaozPXoxgq7oCM+xv+m4qbNx5aI4EIhOa7qKLjm0 fRvwIO0u83K2wCvbWFvrUUWf9W3tS9kjbuQ98Dj1HupMZTMTECpelpIC6s6G6iwHyBc7DO gLKpEYMlUgugQ65EIGOVJ8iT+arWi77R197ln/TmjLr6bDrUabBsxQiXFpU9sfkHJdsRjZ bkDsic4P9pj7y0iRliPSU8r1hKNOOPAuQy1U8y0wFa3wArFf5boMy1eXzqSwYA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 22 Oct 2025 09:38:13 +0200 Subject: [PATCH net-next v2 4/5] net: macb: rename bp->sgmii_phy field to bp->phy Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251022-macb-eyeq5-v2-4-7c140abb0581@bootlin.com> References: <20251022-macb-eyeq5-v2-0-7c140abb0581@bootlin.com> In-Reply-To: <20251022-macb-eyeq5-v2-0-7c140abb0581@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , =?utf-8?q?Gr=C3=A9gory_Clement?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , Vladimir Kondratiev , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The bp->sgmii_phy field is initialised at probe by init_reset_optional() if bp->phy_interface =3D=3D PHY_INTERFACE_MODE_SGMII. It gets used by: - zynqmp_config: "cdns,zynqmp-gem" or "xlnx,zynqmp-gem" compatibles. - mpfs_config: "microchip,mpfs-macb" compatible. - versal_config: "xlnx,versal-gem" compatible. Make name more generic as EyeQ5 requires the PHY in SGMII & RGMII cases. Drop "for ZynqMP SGMII mode" comment that is already a lie, as it gets used on Microchip platforms as well. And soon it won't be SGMII-only. Signed-off-by: Th=C3=A9o Lebrun Reviewed-by: Andrew Lunn Reviewed-by: Maxime Chevallier --- drivers/net/ethernet/cadence/macb.h | 2 +- drivers/net/ethernet/cadence/macb_main.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index 05bfa9bd4782..87414a2ddf6e 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1341,7 +1341,7 @@ struct macb { =20 struct macb_ptp_info *ptp_info; /* macb-ptp interface */ =20 - struct phy *sgmii_phy; /* for ZynqMP SGMII mode */ + struct phy *phy; =20 spinlock_t tsu_clk_lock; /* gem tsu clock locking */ unsigned int tsu_rate; diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 71a472c85a23..914677f30f2c 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2963,7 +2963,7 @@ static int macb_open(struct net_device *dev) =20 macb_init_hw(bp); =20 - err =3D phy_power_on(bp->sgmii_phy); + err =3D phy_power_on(bp->phy); if (err) goto reset_hw; =20 @@ -2979,7 +2979,7 @@ static int macb_open(struct net_device *dev) return 0; =20 phy_off: - phy_power_off(bp->sgmii_phy); + phy_power_off(bp->phy); =20 reset_hw: macb_reset_hw(bp); @@ -3011,7 +3011,7 @@ static int macb_close(struct net_device *dev) phylink_stop(bp->phylink); phylink_disconnect_phy(bp->phylink); =20 - phy_power_off(bp->sgmii_phy); + phy_power_off(bp->phy); =20 spin_lock_irqsave(&bp->lock, flags); macb_reset_hw(bp); @@ -5139,13 +5139,13 @@ static int init_reset_optional(struct platform_devi= ce *pdev) =20 if (bp->phy_interface =3D=3D PHY_INTERFACE_MODE_SGMII) { /* Ensure PHY device used in SGMII mode is ready */ - bp->sgmii_phy =3D devm_phy_optional_get(&pdev->dev, NULL); + bp->phy =3D devm_phy_optional_get(&pdev->dev, NULL); =20 - if (IS_ERR(bp->sgmii_phy)) - return dev_err_probe(&pdev->dev, PTR_ERR(bp->sgmii_phy), + if (IS_ERR(bp->phy)) + return dev_err_probe(&pdev->dev, PTR_ERR(bp->phy), "failed to get SGMII PHY\n"); =20 - ret =3D phy_init(bp->sgmii_phy); + ret =3D phy_init(bp->phy); if (ret) return dev_err_probe(&pdev->dev, ret, "failed to init SGMII PHY\n"); @@ -5174,7 +5174,7 @@ static int init_reset_optional(struct platform_device= *pdev) /* Fully reset controller at hardware level if mapped in device tree */ ret =3D device_reset_optional(&pdev->dev); if (ret) { - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); return dev_err_probe(&pdev->dev, ret, "failed to reset controller"); } =20 @@ -5182,7 +5182,7 @@ static int init_reset_optional(struct platform_device= *pdev) =20 err_out_phy_exit: if (ret) - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); =20 return ret; } @@ -5592,7 +5592,7 @@ static int macb_probe(struct platform_device *pdev) mdiobus_free(bp->mii_bus); =20 err_out_phy_exit: - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); =20 err_out_free_netdev: free_netdev(dev); @@ -5616,7 +5616,7 @@ static void macb_remove(struct platform_device *pdev) if (dev) { bp =3D netdev_priv(dev); unregister_netdev(dev); - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); mdiobus_unregister(bp->mii_bus); mdiobus_free(bp->mii_bus); =20 @@ -5643,7 +5643,7 @@ static int __maybe_unused macb_suspend(struct device = *dev) u32 tmp; =20 if (!device_may_wakeup(&bp->dev->dev)) - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); =20 if (!netif_running(netdev)) return 0; @@ -5772,7 +5772,7 @@ static int __maybe_unused macb_resume(struct device *= dev) int err; =20 if (!device_may_wakeup(&bp->dev->dev)) - phy_init(bp->sgmii_phy); + phy_init(bp->phy); =20 if (!netif_running(netdev)) return 0; --=20 2.51.1