Skip to content

Commit 72977f0

Browse files
claudiubezneageertu
authored andcommitted
clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields
Use FIELD_GET() for PLL register fields. This is its purpose. Signed-off-by: Claudiu Beznea <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent becf4a7 commit 72977f0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/clk/renesas/rzg2l-cpg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Copyright (C) 2015 Renesas Electronics Corp.
1212
*/
1313

14+
#include <linux/bitfield.h>
1415
#include <linux/clk.h>
1516
#include <linux/clk-provider.h>
1617
#include <linux/clk/renesas.h>
@@ -38,14 +39,13 @@
3839
#define WARN_DEBUG(x) do { } while (0)
3940
#endif
4041

41-
#define DIV_RSMASK(v, s, m) ((v >> s) & m)
4242
#define GET_SHIFT(val) ((val >> 12) & 0xff)
4343
#define GET_WIDTH(val) ((val >> 8) & 0xf)
4444

45-
#define KDIV(val) DIV_RSMASK(val, 16, 0xffff)
46-
#define MDIV(val) DIV_RSMASK(val, 6, 0x3ff)
47-
#define PDIV(val) DIV_RSMASK(val, 0, 0x3f)
48-
#define SDIV(val) DIV_RSMASK(val, 0, 0x7)
45+
#define KDIV(val) FIELD_GET(GENMASK(31, 16), val)
46+
#define MDIV(val) FIELD_GET(GENMASK(15, 6), val)
47+
#define PDIV(val) FIELD_GET(GENMASK(5, 0), val)
48+
#define SDIV(val) FIELD_GET(GENMASK(2, 0), val)
4949

5050
#define CLK_ON_R(reg) (reg)
5151
#define CLK_MON_R(reg) (0x180 + (reg))

0 commit comments

Comments
 (0)