Skip to content

Commit 22a6564

Browse files
author
Tero Kristo
committed
clk: ti: clkctrl: convert to use bit helper macros instead of bitops
This improves the readibility of the code slightly, and makes modifying the flags bit simpler. Signed-off-by: Tero Kristo <[email protected]>
1 parent 581eb61 commit 22a6564

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/clk/ti/clkctrl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <linux/timekeeping.h>
2525
#include "clock.h"
2626

27-
#define NO_IDLEST 0x1
27+
#define NO_IDLEST 0
2828

2929
#define OMAP4_MODULEMODE_MASK 0x3
3030

@@ -158,7 +158,7 @@ static int _omap4_clkctrl_clk_enable(struct clk_hw *hw)
158158

159159
ti_clk_ll_ops->clk_writel(val, &clk->enable_reg);
160160

161-
if (clk->flags & NO_IDLEST)
161+
if (test_bit(NO_IDLEST, &clk->flags))
162162
return 0;
163163

164164
/* Wait until module is enabled */
@@ -187,7 +187,7 @@ static void _omap4_clkctrl_clk_disable(struct clk_hw *hw)
187187

188188
ti_clk_ll_ops->clk_writel(val, &clk->enable_reg);
189189

190-
if (clk->flags & NO_IDLEST)
190+
if (test_bit(NO_IDLEST, &clk->flags))
191191
goto exit;
192192

193193
/* Wait until module is disabled */
@@ -596,7 +596,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
596596
if (reg_data->flags & CLKF_HW_SUP)
597597
hw->enable_bit = MODULEMODE_HWCTRL;
598598
if (reg_data->flags & CLKF_NO_IDLEST)
599-
hw->flags |= NO_IDLEST;
599+
set_bit(NO_IDLEST, &hw->flags);
600600

601601
if (reg_data->clkdm_name)
602602
hw->clkdm_name = reg_data->clkdm_name;

include/linux/clk/ti.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct clk_hw_omap {
153153
u8 fixed_div;
154154
struct clk_omap_reg enable_reg;
155155
u8 enable_bit;
156-
u8 flags;
156+
unsigned long flags;
157157
struct clk_omap_reg clksel_reg;
158158
struct dpll_data *dpll_data;
159159
const char *clkdm_name;

0 commit comments

Comments
 (0)