lkml.org 
[lkml]   [2020]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] regmap: provide regmap_assign_bits()
On Thu, Oct 29, 2020 at 4:18 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Mon, Oct 26, 2020 at 04:10:15PM +0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > Add another bits helper to regmap API: this one sets given bits if value
> > is true and clears them if it's false.
>
> What's the use case?
>

Basically what the function does: set bits if a condition is true,
clear them if false. I think this is a common enough use-case to
warrant a helper.

> > +static inline int regmap_assign_bits(struct regmap *map, unsigned int reg,
> > + unsigned int bits, bool value)
>
> I don't have a great suggestion but this naming feels prone to confusion
> with _update_bits().

This is already used in bitops - we have set_bit(), clear_bit() and
assign_bit(). People are used to it and I thought I'd stay consistent
with this naming.

Bartosz

\
 
 \ /
  Last update: 2020-10-29 16:45    [W:0.111 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site