Re: [PATCH 7/7] power: supply: core: convert to fwnnode

Sebastian Reichel
2025-02-25T21:24:09Z

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

Hello Hans,

On Tue, Feb 25, 2025 at 02:16:12PM +0100, Hans de Goede wrote:
> Hi Sebastian,
>
> Thank you for your work on this.
>
> A few small remarks inline / below.
>
> On 25-Feb-25 12:21 AM, Sebastian Reichel wrote:
>
> <snip>
>
> > diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> > index a785742f97721e7e70d0e4c17a1ded7b985acb6d..9afde8c04efc72691c81a373d8dd03477b4efd7e 100644
> > --- a/include/linux/power_supply.h
> > +++ b/include/linux/power_supply.h
> > @@ -805,7 +805,7 @@ static inline struct power_supply *power_supply_get_by_name(const char *name)
> > { return NULL; }
> > #endif
> > #ifdef CONFIG_OF
> > -extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
> > +extern struct power_supply *power_supply_get_by_phandle(struct fwnode_handle *fwnode,
> > const char *property);
>
> this function now no longer is DT/OF/open-firmware specific, so I think it should be moved
> outside of the #ifdef CONFIG_OF block now ? The same goes for the devm variant I think
> and the implementations of course also should no longer be "#ifdef CONFIG_OF".

Good point. I suppose ideally the name should also change to power_supply_get_by_reference,
since phandle is a DT/OF term. I will prepare these two changes for v2.

Greetings,

-- Sebastian

> > extern struct power_supply *devm_power_supply_get_by_phandle(
> > struct device *dev, const char *property);
>
> Regards,
>
> Hans
>
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]