lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Dec 2020 17:02:36 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
Cc:     "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "marek.vasut+renesas@...il.com" <marek.vasut+renesas@...il.com>,
        "yoshihiro.shimoda.uh@...esas.com" <yoshihiro.shimoda.uh@...esas.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "bgolaszewski@...libre.com" <bgolaszewski@...libre.com>,
        "lee.jones@...aro.org" <lee.jones@...aro.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        linux-power <linux-power@...rohmeurope.com>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "khiem.nguyen.xt@...esas.com" <khiem.nguyen.xt@...esas.com>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 03/10] regulator: bd9571mwv: rid of using struct bd9571mwv

Hi Matti,

On Fri, Dec 11, 2020 at 3:03 PM Vaittinen, Matti
<Matti.Vaittinen@...rohmeurope.com> wrote:
> On Fri, 2020-12-11 at 20:27 +0900, Yoshihiro Shimoda wrote:
> > To simplify this driver, use dev_get_regmap() and
> > rid of using struct bd9571mwv.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> > ---
> >  drivers/regulator/bd9571mwv-regulator.c | 49 +++++++++++++++++----
> > ------------
> >  1 file changed, 26 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/regulator/bd9571mwv-regulator.c
> > b/drivers/regulator/bd9571mwv-regulator.c
> > index e690c2c..02120b0 100644
> > --- a/drivers/regulator/bd9571mwv-regulator.c
> > +++ b/drivers/regulator/bd9571mwv-regulator.c
> > @@ -17,7 +17,7 @@
> >  #include <linux/mfd/bd9571mwv.h>
> >
> >  struct bd9571mwv_reg {
> > -     struct bd9571mwv *bd;
> > +     struct regmap *regmap;
>
> As a 'nit':
> I might consider adding the dev pointer here to avoid extra argument
> with all the bkup_mode functions below. (just pass this struct and
> mode). But that's only my preference - feel free to ignore this comment
> if patch is Ok to Mark, Marek & Others :)

Struct regmap already contains a struct device pointer, but that's internal
to regmap.

Perhaps adding a regmap_device() helper to retrieve the device pointer
might be worthwhile?
Or a regmap_err() helper to print error messages?

>
> Overall, looks good to me :)
> Reviewed-By: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
>
> >
> >       /* DDR Backup Power */
> >       u8 bkup_mode_cnt_keepon;        /* from "rohm,ddr-backup-power" */
> > @@ -137,26 +137,30 @@ static const struct regulator_desc regulators[]
> > = {
> >  };
> >
> >  #ifdef CONFIG_PM_SLEEP
> > -static int bd9571mwv_bkup_mode_read(struct bd9571mwv *bd, unsigned
> > int *mode)
> > +static int bd9571mwv_bkup_mode_read(struct device * dev,
> > +                                 struct bd9571mwv_reg *bdreg,
> > +                                 unsigned int *mode)
> >  {
> >       int ret;
> >
> > -     ret = regmap_read(bd->regmap, BD9571MWV_BKUP_MODE_CNT, mode);
> > +     ret = regmap_read(bdreg->regmap, BD9571MWV_BKUP_MODE_CNT,
> > mode);
> >       if (ret) {
> > -             dev_err(bd->dev, "failed to read backup mode (%d)\n",
> > ret);
> > +             dev_err(dev, "failed to read backup mode (%d)\n", ret);
> >               return ret;
> >       }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists