Skip to content

Commit 48d4773

Browse files
Nicolas FrattaroliYuryNorov
authored andcommitted
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>
1 parent dcdcfd8 commit 48d4773

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/phy/rockchip/phy-rockchip-emmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/clk.h>
1010
#include <linux/delay.h>
11+
#include <linux/hw_bitfield.h>
1112
#include <linux/mfd/syscon.h>
1213
#include <linux/module.h>
1314
#include <linux/of.h>
@@ -21,7 +22,7 @@
2122
* only if BIT(x + 16) set to 1 the BIT(x) can be written.
2223
*/
2324
#define HIWORD_UPDATE(val, mask, shift) \
24-
((val) << (shift) | (mask) << ((shift) + 16))
25+
(FIELD_PREP_WM16((mask) << (shift), (val)))
2526

2627
/* Register definition */
2728
#define GRF_EMMCPHY_CON0 0x0

0 commit comments

Comments
 (0)