Skip to content

Commit b08fa38

Browse files
bijudasbebarino
authored andcommitted
clk: versaclock3: Drop ret variable
Drop ret variable from vc3_clk_mux_determine_rate(). While at it, return the value returned by regmap_* wherever possible instead of returning 0. Signed-off-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 1235110 commit b08fa38

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

drivers/clk/clk-versaclock3.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,8 @@ static int vc3_pfd_mux_set_parent(struct clk_hw *hw, u8 index)
226226
struct vc3_hw_data *vc3 = container_of(hw, struct vc3_hw_data, hw);
227227
const struct vc3_clk_data *pfd_mux = vc3->data;
228228

229-
regmap_update_bits(vc3->regmap, pfd_mux->offs, pfd_mux->bitmsk,
230-
index ? pfd_mux->bitmsk : 0);
231-
return 0;
229+
return regmap_update_bits(vc3->regmap, pfd_mux->offs, pfd_mux->bitmsk,
230+
index ? pfd_mux->bitmsk : 0);
232231
}
233232

234233
static const struct clk_ops vc3_pfd_mux_ops = {
@@ -456,10 +455,8 @@ static int vc3_div_mux_set_parent(struct clk_hw *hw, u8 index)
456455
struct vc3_hw_data *vc3 = container_of(hw, struct vc3_hw_data, hw);
457456
const struct vc3_clk_data *div_mux = vc3->data;
458457

459-
regmap_update_bits(vc3->regmap, div_mux->offs, div_mux->bitmsk,
460-
index ? div_mux->bitmsk : 0);
461-
462-
return 0;
458+
return regmap_update_bits(vc3->regmap, div_mux->offs, div_mux->bitmsk,
459+
index ? div_mux->bitmsk : 0);
463460
}
464461

465462
static const struct clk_ops vc3_div_mux_ops = {
@@ -524,10 +521,9 @@ static int vc3_div_set_rate(struct clk_hw *hw, unsigned long rate,
524521

525522
value = divider_get_val(rate, parent_rate, div_data->table,
526523
div_data->width, div_data->flags);
527-
regmap_update_bits(vc3->regmap, div_data->offs,
528-
VC3_DIV_MASK(div_data->width) << div_data->shift,
529-
value << div_data->shift);
530-
return 0;
524+
return regmap_update_bits(vc3->regmap, div_data->offs,
525+
VC3_DIV_MASK(div_data->width) << div_data->shift,
526+
value << div_data->shift);
531527
}
532528

533529
static const struct clk_ops vc3_div_ops = {
@@ -539,11 +535,9 @@ static const struct clk_ops vc3_div_ops = {
539535
static int vc3_clk_mux_determine_rate(struct clk_hw *hw,
540536
struct clk_rate_request *req)
541537
{
542-
int ret;
543538
int frc;
544539

545-
ret = clk_mux_determine_rate_flags(hw, req, CLK_SET_RATE_PARENT);
546-
if (ret) {
540+
if (clk_mux_determine_rate_flags(hw, req, CLK_SET_RATE_PARENT)) {
547541
/* The below check is equivalent to (best_parent_rate/rate) */
548542
if (req->best_parent_rate >= req->rate) {
549543
frc = DIV_ROUND_CLOSEST_ULL(req->best_parent_rate,
@@ -552,10 +546,9 @@ static int vc3_clk_mux_determine_rate(struct clk_hw *hw,
552546
return clk_mux_determine_rate_flags(hw, req,
553547
CLK_SET_RATE_PARENT);
554548
}
555-
ret = 0;
556549
}
557550

558-
return ret;
551+
return 0;
559552
}
560553

561554
static u8 vc3_clk_mux_get_parent(struct clk_hw *hw)
@@ -574,9 +567,8 @@ static int vc3_clk_mux_set_parent(struct clk_hw *hw, u8 index)
574567
struct vc3_hw_data *vc3 = container_of(hw, struct vc3_hw_data, hw);
575568
const struct vc3_clk_data *clk_mux = vc3->data;
576569

577-
regmap_update_bits(vc3->regmap, clk_mux->offs,
578-
clk_mux->bitmsk, index ? clk_mux->bitmsk : 0);
579-
return 0;
570+
return regmap_update_bits(vc3->regmap, clk_mux->offs, clk_mux->bitmsk,
571+
index ? clk_mux->bitmsk : 0);
580572
}
581573

582574
static const struct clk_ops vc3_clk_mux_ops = {

0 commit comments

Comments
 (0)