Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <nicolas.frattaroli@collabora.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>

authored by

Nicolas Frattaroli and committed by
Yury Norov
48d47732 dcdcfd83

+2 -1
+2 -1
drivers/phy/rockchip/phy-rockchip-emmc.c
··· 8 8 9 9 #include <linux/clk.h> 10 10 #include <linux/delay.h> 11 + #include <linux/hw_bitfield.h> 11 12 #include <linux/mfd/syscon.h> 12 13 #include <linux/module.h> 13 14 #include <linux/of.h> ··· 22 21 * only if BIT(x + 16) set to 1 the BIT(x) can be written. 23 22 */ 24 23 #define HIWORD_UPDATE(val, mask, shift) \ 25 - ((val) << (shift) | (mask) << ((shift) + 16)) 24 + (FIELD_PREP_WM16((mask) << (shift), (val))) 26 25 27 26 /* Register definition */ 28 27 #define GRF_EMMCPHY_CON0 0x0