From: Nicolas Frattaroli Date: Mon, 25 Aug 2025 08:28:26 +0000 (+0200) Subject: phy: rockchip-emmc: switch to FIELD_PREP_WM16 macro X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=48d47732c29bf8002f41c275adacd63d033ef6d2;p=users%2Fhch%2Fmisc.git phy: rockchip-emmc: switch to FIELD_PREP_WM16 macro The era of hand-rolled HIWORD_UPDATE macros is over, at least for those drivers that use constant masks. Replace the implementation of the rockchip eMMC PHY driver's HIWORD_UPDATE macro with hw_bitfield.h's FIELD_PREP_WM16. This makes the change more easily reviewable. Signed-off-by: Nicolas Frattaroli Acked-by: Heiko Stuebner Signed-off-by: Yury Norov (NVIDIA) --- diff --git a/drivers/phy/rockchip/phy-rockchip-emmc.c b/drivers/phy/rockchip/phy-rockchip-emmc.c index 20023f6eb994..5187983c58e5 100644 --- a/drivers/phy/rockchip/phy-rockchip-emmc.c +++ b/drivers/phy/rockchip/phy-rockchip-emmc.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -21,7 +22,7 @@ * only if BIT(x + 16) set to 1 the BIT(x) can be written. */ #define HIWORD_UPDATE(val, mask, shift) \ - ((val) << (shift) | (mask) << ((shift) + 16)) + (FIELD_PREP_WM16((mask) << (shift), (val))) /* Register definition */ #define GRF_EMMCPHY_CON0 0x0