Skip to content
Snippets Groups Projects
Commit 1d8e0223 authored by Cai Huoqing's avatar Cai Huoqing Committed by Krzysztof Kozlowski
Browse files

memory: tegra: Make use of the helper function devm_add_action_or_reset()


Use devm_add_action_or_reset() instead of devm_add_action() to simplify
the error handling.

Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210922130002.586-1-caihuoqing@baidu.com


Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
parent 13324edb
No related branches found
No related tags found
No related merge requests found
...@@ -87,11 +87,9 @@ struct tegra_mc *devm_tegra_memory_controller_get(struct device *dev) ...@@ -87,11 +87,9 @@ struct tegra_mc *devm_tegra_memory_controller_get(struct device *dev)
return ERR_PTR(-EPROBE_DEFER); return ERR_PTR(-EPROBE_DEFER);
} }
err = devm_add_action(dev, tegra_mc_devm_action_put_device, mc); err = devm_add_action_or_reset(dev, tegra_mc_devm_action_put_device, mc);
if (err) { if (err)
put_device(mc->dev);
return ERR_PTR(err); return ERR_PTR(err);
}
return mc; return mc;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment