On 11/11/21 2:35 AM, Biju Das wrote:
[ ... [
+
+ ret = devm_add_action_or_reset(&pdev->dev,
+ rzg2l_wdt_reset_assert_pm_disable_put,
+ &priv->wdev);
+ if (ret < 0)
+ goto out_reset;
_or_reset implies that the action is taken on failure, so there is not
need to do it again.
As per [1], it can return -ENOMEM, in that case I don't get action callback. On a safer side
I will move this call after watchdog_set_drvdata()
[1] https://elixir.bootlin.com/linux/latest/source/drivers/base/devres.c#L734
That points to devm_add_action(), not to devm_add_action_or_reset().
Guenter