Re: [PATCH v2 2/2] power: supply: bq25630: Initialize hardware before exposing the power supply

Waqar Hameed <[email protected]>
Newsgroups org.kernel.vger.linux-pm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Jul 28, 2026 at 10:45 +0800 Linmao Li <[email protected]> wrote:

> bq25630_setup() resets the device, disables the watchdog and programs
> the charge limits from the battery information. It runs at the end of
> bq25630_probe(), that is after the power supply has been registered, so
> the device is already exposed to the system while the hardware still
> holds its power-on defaults.
>
> power_supply_desc::init runs during registration, after the driver data
> and the fwnode are available and before the device is added. Use it for
> bq25630_setup() and drop the explicit call from bq25630_probe().
>
> The callback is passed the power supply, so take the driver data from it
> and use it for the battery information as well: data->psy is only
> assigned once devm_power_supply_register() returns, which is after the
> callback has run.
>
> Signed-off-by: Linmao Li <[email protected]>

Looks good to me!

Reviewed-by: Waqar Hameed <[email protected]>

[...]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.