Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: renesas: rzg3e-usb3: Convert to FIELD_MODIFY()
@ 2026-03-05 10:15 Geert Uytterhoeven
  2026-03-06 10:35 ` Neil Armstrong
  2026-05-10 12:24 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-03-05 10:15 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Biju Das
  Cc: linux-phy, linux-renesas-soc, Geert Uytterhoeven

Use the FIELD_MODIFY() helper instead of open-coding the same operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
No changes in generated code.
---
 drivers/phy/renesas/phy-rzg3e-usb3.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/renesas/phy-rzg3e-usb3.c b/drivers/phy/renesas/phy-rzg3e-usb3.c
index 6b3453ea0004cf59..7f809ef1bb5135ec 100644
--- a/drivers/phy/renesas/phy-rzg3e-usb3.c
+++ b/drivers/phy/renesas/phy-rzg3e-usb3.c
@@ -78,13 +78,11 @@ static void rzg3e_phy_usb2test_phy_init(void __iomem *base)
 	writel(val, base + USB3_TEST_UTMICTRL2);
 
 	val = readl(base + USB3_TEST_PRMCTRL5_R);
-	val &= ~USB3_TEST_PRMCTRL5_R_TXPREEMPAMPTUNE0_MASK;
-	val |= FIELD_PREP(USB3_TEST_PRMCTRL5_R_TXPREEMPAMPTUNE0_MASK, 2);
+	FIELD_MODIFY(USB3_TEST_PRMCTRL5_R_TXPREEMPAMPTUNE0_MASK, &val, 2);
 	writel(val, base + USB3_TEST_PRMCTRL5_R);
 
 	val = readl(base + USB3_TEST_PRMCTRL6_R);
-	val &= ~USB3_TEST_PRMCTRL6_R_OTGTUNE0_MASK;
-	val |= FIELD_PREP(USB3_TEST_PRMCTRL6_R_OTGTUNE0_MASK, 7);
+	FIELD_MODIFY(USB3_TEST_PRMCTRL6_R_OTGTUNE0_MASK, &val, 7);
 	writel(val, base + USB3_TEST_PRMCTRL6_R);
 
 	val = readl(base + USB3_TEST_RESET);
-- 
2.43.0


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: renesas: rzg3e-usb3: Convert to FIELD_MODIFY()
  2026-03-05 10:15 [PATCH] phy: renesas: rzg3e-usb3: Convert to FIELD_MODIFY() Geert Uytterhoeven
@ 2026-03-06 10:35 ` Neil Armstrong
  2026-05-10 12:24 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2026-03-06 10:35 UTC (permalink / raw)
  To: Geert Uytterhoeven, Vinod Koul, Biju Das; +Cc: linux-phy, linux-renesas-soc

On 3/5/26 11:15, Geert Uytterhoeven wrote:
> Use the FIELD_MODIFY() helper instead of open-coding the same operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> No changes in generated code.
> ---
>   drivers/phy/renesas/phy-rzg3e-usb3.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/phy/renesas/phy-rzg3e-usb3.c b/drivers/phy/renesas/phy-rzg3e-usb3.c
> index 6b3453ea0004cf59..7f809ef1bb5135ec 100644
> --- a/drivers/phy/renesas/phy-rzg3e-usb3.c
> +++ b/drivers/phy/renesas/phy-rzg3e-usb3.c
> @@ -78,13 +78,11 @@ static void rzg3e_phy_usb2test_phy_init(void __iomem *base)
>   	writel(val, base + USB3_TEST_UTMICTRL2);
>   
>   	val = readl(base + USB3_TEST_PRMCTRL5_R);
> -	val &= ~USB3_TEST_PRMCTRL5_R_TXPREEMPAMPTUNE0_MASK;
> -	val |= FIELD_PREP(USB3_TEST_PRMCTRL5_R_TXPREEMPAMPTUNE0_MASK, 2);
> +	FIELD_MODIFY(USB3_TEST_PRMCTRL5_R_TXPREEMPAMPTUNE0_MASK, &val, 2);
>   	writel(val, base + USB3_TEST_PRMCTRL5_R);
>   
>   	val = readl(base + USB3_TEST_PRMCTRL6_R);
> -	val &= ~USB3_TEST_PRMCTRL6_R_OTGTUNE0_MASK;
> -	val |= FIELD_PREP(USB3_TEST_PRMCTRL6_R_OTGTUNE0_MASK, 7);
> +	FIELD_MODIFY(USB3_TEST_PRMCTRL6_R_OTGTUNE0_MASK, &val, 7);
>   	writel(val, base + USB3_TEST_PRMCTRL6_R);
>   
>   	val = readl(base + USB3_TEST_RESET);

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: renesas: rzg3e-usb3: Convert to FIELD_MODIFY()
  2026-03-05 10:15 [PATCH] phy: renesas: rzg3e-usb3: Convert to FIELD_MODIFY() Geert Uytterhoeven
  2026-03-06 10:35 ` Neil Armstrong
@ 2026-05-10 12:24 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2026-05-10 12:24 UTC (permalink / raw)
  To: Neil Armstrong, Biju Das, Geert Uytterhoeven; +Cc: linux-phy, linux-renesas-soc


On Thu, 05 Mar 2026 11:15:28 +0100, Geert Uytterhoeven wrote:
> Use the FIELD_MODIFY() helper instead of open-coding the same operation.
> 
> 

Applied, thanks!

[1/1] phy: renesas: rzg3e-usb3: Convert to FIELD_MODIFY()
      commit: 5e2871746039e69657623b222b30c1c6f52159f0

Best regards,
-- 
~Vinod



-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-10 12:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 10:15 [PATCH] phy: renesas: rzg3e-usb3: Convert to FIELD_MODIFY() Geert Uytterhoeven
2026-03-06 10:35 ` Neil Armstrong
2026-05-10 12:24 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox