Re: [PATCH 1/3] power_supply: add power_supply_get_by_phandle
From: Sebastian Reichel
Date: Mon Dec 23 2013 - 22:37:39 EST
On Mon, Dec 23, 2013 at 06:20:36PM -0800, Anton Vorontsov wrote:
> On Sun, Nov 24, 2013 at 05:49:29PM +0100, Sebastian Reichel wrote:
> > Add method to get power supply by device tree phandle.
> >
> > Signed-off-by: Sebastian Reichel <sre@xxxxxxxxxx>
> > ---
> > drivers/power/power_supply_core.c | 24 ++++++++++++++++++++++++
> > include/linux/power_supply.h | 2 ++
> > 2 files changed, 26 insertions(+)
> >
> > diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
> > index 08bce22..99e4b41 100644
> > --- a/drivers/power/power_supply_core.c
> > +++ b/drivers/power/power_supply_core.c
> > @@ -340,6 +340,30 @@ struct power_supply *power_supply_get_by_name(const char *name)
> ...
> > +
> > + dev = class_find_device(power_supply_class, NULL, power_supply_np,
> > + power_supply_match_device_node);
> > +
> > + of_node_put(power_supply_np);
> > +
> > + return dev ? dev_get_drvdata(dev) : NULL;
> > +}
> > +EXPORT_SYMBOL_GPL(power_supply_get_by_phandle);
>
> The code had no !CONFIG_OF protection so I had to make the following
> changes to this patch:
Right. Thanks for queuing.
-- Sebastian
Attachment:
signature.asc
Description: Digital signature