From c406563c02de0968dd1cd84eb1c4c0b25fbca447 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Tue, 5 Jul 2016 11:50:48 +0530 Subject: platform: tegra_prod: Add devm_tegra_prod_get_from_node() Add managed version of the prod API devm_tegra_prod_get_from_node() so that client need not to explicitly clean the allocated resources. Change-Id: I9dbc7f16228dd8179ef123e55a0ff8be3753d447 Signed-off-by: Laxman Dewangan Reviewed-on: http://git-master/r/1175452 Reviewed-on: https://git-master.nvidia.com/r/1768538 Tested-by: Nicolin Chen GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/tegra_prod.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/linux') diff --git a/include/linux/tegra_prod.h b/include/linux/tegra_prod.h index c79519c50..37e84022b 100644 --- a/include/linux/tegra_prod.h +++ b/include/linux/tegra_prod.h @@ -87,6 +87,24 @@ struct tegra_prod *devm_tegra_prod_get(struct device *dev); */ struct tegra_prod *tegra_prod_get_from_node(struct device_node *np); +/** + * devm_tegra_prod_get_from_node(): Get the prod handle from the node. + * @dev: Device handle. + * @np: Node pointer on which prod setting nodes are available. + * + * Parse the prod-setting node of the node pointer "np" and keep all prod + * setting data in prod handle. + * This handle is used for setting prod configurations. + * + * Returns valid prod_list handle on success or pointer to the error + * when it failed. + * The allocated resource is released by driver core framework when device + * is unbinded and so no need to call any release APIs for the tegra_prod + * handle. + */ +struct tegra_prod *devm_tegra_prod_get_from_node(struct device *dev, + struct device_node *np); + /** * tegra_prod_put(): Put the allocated prod handle. * @tegra_prod: Tegra prod handle which was allocated by function -- cgit v1.2.2