From nobody Mon Feb 9 12:42:40 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 786F830ACFF; Thu, 23 Oct 2025 16:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761236604; cv=none; b=qrbLSCGa6A3lro7y6pRZwLCNcohVfZpGzpKQ2Vhy6qv9zKfOywhu9mv7fuC/S6WWa/RzTmVqP7HZIjZo5oy1R6alx3r6zisJt2yl3e2j1tKJtrWbR86Tn9eA9Q3geyq3SnxcsrhvODiR9C0af6smh81bHh9GzzH1DXEWSKxs9wA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761236604; c=relaxed/simple; bh=Yarsu4uhSLB3FJ1cHK2srBqjp/s6m4XAw0u/FPKQHUM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s5qc6ZG60gR9QzfQNEid41xSQvh7CNxZ99pmY9zrZ4YxS69gFZNNN1RlpDuqHZg/EbNGswgVaUi1oS6sAxQQRybIdMB85ypGv9AO6WzNZmJJx+XISFV+z/R8iPsHUkbObmVf2p0S2tE508yl/uwJHEyDUMN3PMOMYvghoclPvbk= 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=xPYy8HOU; arc=none smtp.client-ip=185.171.202.116 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="xPYy8HOU" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 09F0DC0C430; Thu, 23 Oct 2025 16:23:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id DDBF9606DE; Thu, 23 Oct 2025 16:23:20 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 90502102F246C; Thu, 23 Oct 2025 18:23:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761236599; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=8RNDmW36KMuKuYt5YOI1V2Yuesuf7NyM/xPRiEzXIF4=; b=xPYy8HOU2j4YU4kOJOwbopzzHc9BV9X/cU+MirOwbtkdLkqmoLtiLJ46b/KiULluaO67Dw DtFgGSwI9+rkaTTIwdrTstd24ydJV81yYvsUsFnGPEWnDgAW7hvsv+ASx0jfVjKdMEwyec K4/sW69csDNvkHb9gpBPwtUzNxr2UVw+iYCI7yZBdRXqdAhuFmluwA4s9vnOETef1QoO9A rhHh/8ITEdNrSShIikKjpeSlC7mRe6Duak4vfOzF881XSsrzwtO/p019HkmPPhaxkdprno KBx1ZinBKukBcZbK+ZfQDyZRmfiOCuUreL7s/YjLglB4BKXVD/NTwstxm8YLfw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Thu, 23 Oct 2025 18:22:54 +0200 Subject: [PATCH net-next v3 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: <20251023-macb-eyeq5-v3-4-af509422c204@bootlin.com> References: <20251023-macb-eyeq5-v3-0-af509422c204@bootlin.com> In-Reply-To: <20251023-macb-eyeq5-v3-0-af509422c204@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?= , Andrew Lunn 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. Reviewed-by: Andrew Lunn Reviewed-by: Maxime Chevallier Signed-off-by: Th=C3=A9o Lebrun Acked-by: Nicolas Ferre --- 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 8b688a6cb2f9..44188e7eee56 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2965,7 +2965,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 @@ -2981,7 +2981,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); @@ -3013,7 +3013,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); @@ -5141,13 +5141,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"); @@ -5176,7 +5176,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 @@ -5184,7 +5184,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; } @@ -5594,7 +5594,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); @@ -5618,7 +5618,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 @@ -5645,7 +5645,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; @@ -5774,7 +5774,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