File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -903,9 +903,9 @@ static int rzg2l_mod_clock_endisable(struct clk_hw *hw, bool enable)
903
903
unsigned int reg = clock -> off ;
904
904
struct device * dev = priv -> dev ;
905
905
unsigned long flags ;
906
- unsigned int i ;
907
906
u32 bitmask = BIT (clock -> bit );
908
907
u32 value ;
908
+ int error ;
909
909
910
910
if (!clock -> off ) {
911
911
dev_dbg (dev , "%pC does not support ON/OFF\n" , hw -> clk );
@@ -930,19 +930,13 @@ static int rzg2l_mod_clock_endisable(struct clk_hw *hw, bool enable)
930
930
if (!priv -> info -> has_clk_mon_regs )
931
931
return 0 ;
932
932
933
- for (i = 1000 ; i > 0 ; -- i ) {
934
- if (((readl (priv -> base + CLK_MON_R (reg ))) & bitmask ))
935
- break ;
936
- cpu_relax ();
937
- }
938
-
939
- if (!i ) {
933
+ error = readl_poll_timeout_atomic (priv -> base + CLK_MON_R (reg ), value ,
934
+ value & bitmask , 0 , 10 );
935
+ if (error )
940
936
dev_err (dev , "Failed to enable CLK_ON %p\n" ,
941
937
priv -> base + CLK_ON_R (reg ));
942
- return - ETIMEDOUT ;
943
- }
944
938
945
- return 0 ;
939
+ return error ;
946
940
}
947
941
948
942
static int rzg2l_mod_clock_enable (struct clk_hw * hw )
You can’t perform that action at this time.
0 commit comments