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]
Message-ID: <20180222204615.ogyplmoq5oxpudtk@earth.universe>
Date:   Thu, 22 Feb 2018 21:46:15 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     "Pierre Bourdon (delroth)" <delroth@...gle.com>
Cc:     Andy Shevchenko <andy.shevchenko@...il.com>,
        Andre Heider <a.heider@...il.com>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] max17042: propagate of_node to power supply device

Hi,

On Tue, Feb 20, 2018 at 06:58:56PM +0100, Pierre Bourdon (delroth) wrote:
> On Tue, Feb 20, 2018 at 6:34 PM, Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> > On Tue, Feb 20, 2018 at 5:03 PM, Pierre Bourdon <delroth@...gle.com> wrote:
> >> max17042_get_status uses the core power_supply_am_i_supplied. That
> >> function relies on DT properties to figure out the power supply
> >> topology, and will error out without DT.
> >
> >> +       psy_cfg.of_node = dev->of_node;
> >
> > Perhaps do this in general manner, see how GPIOLIB takes care of it:
> >
> > $ git grep -n -A4 -w CONFIG_OF_GPIO -- drivers/gpio/gpiolib.c
> > drivers/gpio/gpiolib.c:1161:#ifdef CONFIG_OF_GPIO
> > drivers/gpio/gpiolib.c-1162-    /* If the gpiochip has an assigned OF
> > node this takes precedence */
> > drivers/gpio/gpiolib.c-1163-    if (chip->of_node)
> > drivers/gpio/gpiolib.c-1164-            gdev->dev.of_node = chip->of_node;
> > drivers/gpio/gpiolib.c-1165-#endif
> > ...
> 
> Makes sense. From a quick look in existing drivers, it looks like the
> only values being used currently as psy_cfg.of_node are the nodes from
> the parent device, so it seems like it could be made generic.
> 
> Are we aware of any driver that is not propagating the of_node on
> purpose? Is this something that should be supported? If not, I guess
> we could get rid of power_supply_config.of_node and always use the one
> from the parent device in __power_supply_register.
> 
> (I'm very new to this codebase, sorry for the possibly dumb questions!)

I think it makes sense to keep psy_cfg.of_node in case a driver
needs to use a subnode for some reason. I think it makes sense
to use dev->of_node as default value, though. Anyways I have
applied this patch to my fixes branch.

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ