Re: [PATCH] clk: tenstorrent: use regmap_assign_bits() for conditional set/clear

From: Drew Fustini

Date: Tue Sep 29 2026 - 15:58:56 EST


On Thu, Sep 24, 2026 at 12:10:36PM -0700, Drew Fustini wrote:
> On Thu, Sep 24, 2026 at 04:34:38PM +0800, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@xxxxxxx>
> >
> > Replace if/else blocks using regmap_set_bits()/regmap_clear_bits() with
> > the simpler regmap_assign_bits() call.
> >
> > Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
> > ---
> > drivers/clk/tenstorrent/atlantis-prcm.c | 11 +++--------
> > 1 file changed, 3 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/clk/tenstorrent/atlantis-prcm.c b/drivers/clk/tenstorrent/atlantis-prcm.c
> > index 6d4386eeb7dae..854b9c48816f2 100644
> > --- a/drivers/clk/tenstorrent/atlantis-prcm.c
> > +++ b/drivers/clk/tenstorrent/atlantis-prcm.c
> > @@ -205,14 +205,9 @@ static int atlantis_clk_gate_endisable(struct clk_hw *hw, int enable)
> > {
> > struct atlantis_clk_gate *gate = hw_to_atlantis_clk_gate(hw);
> >
> > - if (enable)
> > - return regmap_set_bits(gate->common.regmap,
> > - gate->config.reg_offset,
> > - gate->config.enable);
> > - else
> > - return regmap_clear_bits(gate->common.regmap,
> > - gate->config.reg_offset,
> > - gate->config.enable);
> > + return regmap_assign_bits(gate->common.regmap,
> > + gate->config.reg_offset,
> > + gate->config.enable, enable);
> > }
> >
> > static int atlantis_clk_gate_enable(struct clk_hw *hw)
> > --
> > 2.50.1
>
> Reviewed-by: Drew Fustini (Tenstorrent) <fustini@xxxxxxxxxx>
>
> I will apply this to tenstorrent-clk-for-next.

Applied to tenstorrent-clk-for-next:

d5e56ca6c53b clk: tenstorrent: use regmap_assign_bits() for conditional set/clear

Thanks,
Drew