power: supply: Remove error prints for devm_add_action_or_reset()

When `devm_add_action_or_reset()` fails, it is due to a failed memory
allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do
anything when error is `-ENOMEM`. Therefore, remove the useless call to
`dev_err_probe()` when `devm_add_action_or_reset()` fails, and just
return the value instead.

Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Waqar Hameed 2025-08-05 11:33:35 +02:00 committed by Sebastian Reichel
parent 5afce048a9
commit 32f350d585
2 changed files with 6 additions and 6 deletions

View File

@ -898,7 +898,7 @@ static int mt6370_chg_probe(struct platform_device *pdev)
ret = devm_add_action_or_reset(dev, mt6370_chg_destroy_attach_lock,
&priv->attach_lock);
if (ret)
return dev_err_probe(dev, ret, "Failed to init attach lock\n");
return ret;
priv->attach = MT6370_ATTACH_STAT_DETACH;
@ -909,7 +909,7 @@ static int mt6370_chg_probe(struct platform_device *pdev)
ret = devm_add_action_or_reset(dev, mt6370_chg_destroy_wq, priv->wq);
if (ret)
return dev_err_probe(dev, ret, "Failed to init wq\n");
return ret;
ret = devm_work_autocancel(dev, &priv->bc12_work, mt6370_chg_bc12_work_func);
if (ret)

View File

@ -1218,25 +1218,25 @@ static int rt9467_charger_probe(struct i2c_client *i2c)
ret = devm_add_action_or_reset(dev, rt9467_chg_destroy_adc_lock,
&data->adc_lock);
if (ret)
return dev_err_probe(dev, ret, "Failed to init ADC lock\n");
return ret;
mutex_init(&data->attach_lock);
ret = devm_add_action_or_reset(dev, rt9467_chg_destroy_attach_lock,
&data->attach_lock);
if (ret)
return dev_err_probe(dev, ret, "Failed to init attach lock\n");
return ret;
mutex_init(&data->ichg_ieoc_lock);
ret = devm_add_action_or_reset(dev, rt9467_chg_destroy_ichg_ieoc_lock,
&data->ichg_ieoc_lock);
if (ret)
return dev_err_probe(dev, ret, "Failed to init ICHG/IEOC lock\n");
return ret;
init_completion(&data->aicl_done);
ret = devm_add_action_or_reset(dev, rt9467_chg_complete_aicl_done,
&data->aicl_done);
if (ret)
return dev_err_probe(dev, ret, "Failed to init AICL done completion\n");
return ret;
ret = rt9467_do_charger_init(data);
if (ret)