Re: [PATCH] power: supply: rk817: check correct variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sat, Oct 15, 2022 at 11:26:37AM +0300, Dan Carpenter wrote:
> This code checks "->chg_ps" twice when it was supposed to check
> "->bat_ps".
> 
> Fixes: 11cb8da0189b ("power: supply: Add charger driver for Rockchip RK817")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---

Thanks, queued to fixes branch.

-- Sebastian

>  drivers/power/supply/rk817_charger.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c
> index 635f051b0821..4e9c7b191266 100644
> --- a/drivers/power/supply/rk817_charger.c
> +++ b/drivers/power/supply/rk817_charger.c
> @@ -1116,14 +1116,12 @@ static int rk817_charger_probe(struct platform_device *pdev)
>  
>  	charger->bat_ps = devm_power_supply_register(&pdev->dev,
>  						     &rk817_bat_desc, &pscfg);
> -
> -	charger->chg_ps = devm_power_supply_register(&pdev->dev,
> -						     &rk817_chg_desc, &pscfg);
> -
> -	if (IS_ERR(charger->chg_ps))
> +	if (IS_ERR(charger->bat_ps))
>  		return dev_err_probe(dev, -EINVAL,
>  				     "Battery failed to probe\n");
>  
> +	charger->chg_ps = devm_power_supply_register(&pdev->dev,
> +						     &rk817_chg_desc, &pscfg);
>  	if (IS_ERR(charger->chg_ps))
>  		return dev_err_probe(dev, -EINVAL,
>  				     "Charger failed to probe\n");
> -- 
> 2.35.1
> 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux