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] [day] [month] [year] [list]
Date:   Wed, 16 Dec 2020 06:55:51 +0000
From:   "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To:     "yoshihiro.shimoda.uh@...esas.com" <yoshihiro.shimoda.uh@...esas.com>,
        "geert@...ux-m68k.org" <geert@...ux-m68k.org>
CC:     "khiem.nguyen.xt@...esas.com" <khiem.nguyen.xt@...esas.com>,
        "bgolaszewski@...libre.com" <bgolaszewski@...libre.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>,
        "lee.jones@...aro.org" <lee.jones@...aro.org>,
        linux-power <linux-power@...rohmeurope.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "marek.vasut+renesas@...il.com" <marek.vasut+renesas@...il.com>
Subject: Re: [PATCH v2 03/10] regulator: bd9571mwv: rid of using struct
 bd9571mwv


On Wed, 2020-12-16 at 06:29 +0000, Yoshihiro Shimoda wrote:
> Hi Matti-san,
> 
> > From: Vaittinen, Matti, Sent: Wednesday, December 16, 2020 3:00 PM
> > On Wed, 2020-12-16 at 02:13 +0000, Yoshihiro Shimoda wrote:
> > > Hi Geert-san, Matti-san,
> > > 
> > > > From: Geert Uytterhoeven, Sent: Wednesday, December 16, 2020
> > > > 1:13
> > > > AM
> > > > On Tue, Dec 15, 2020 at 5:02 PM Geert Uytterhoeven <
> > > > geert@...ux-m68k.org> wrote:
> > > > > 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:
> > > <snip>
> > > > > > > --- 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?
> > > > 
> > > > -EEXISTS ;-)
> > > > 
> > > > struct device *regmap_get_device(struct regmap *map)
> > > 
> > > Thank you for finding this. I'll fix this patch.
> > 
> > Just a small reminder that this device is probably the MFD device,
> > not
> > the device created for regulator driver. (Regmap is created for
> > MFD).
> > For prints this only means we're issuing prints as if MFD device
> > generated them, right? I'm not sure it is the best approach - but
> > I'll
> > leave this to Mark & others to judge :)
> 
> Thank you for the comment. You're correct. regmap_get_device() is
> the MFD device. Also, original code had used the MFD device as
> "dev_err(bd->dev, ...)". So, printk behavior is the same as before :)

Right. I must admit didn't catch that. I actually think using the
&pdev->dev for prints issued by the regulator driver would be more
correct but I'm not complaining if using MFD device is Ok to Mark &
others :) I do appreciate your work with this, thanks!

> 
> Best regards,
> Yoshihiro Shimoda
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ