summaryrefslogtreecommitdiff
path: root/drivers/misc/tegra-fuse
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2014-02-13 13:04:59 +0530
committerLaxman Dewangan <ldewangan@nvidia.com>2014-02-13 06:09:33 -0800
commit72cc7aea560d68393bfc3a03ebd5c851ec648d01 (patch)
treedbf5b2e5ecf46df99bae8d214b153f6d1fc0d875 /drivers/misc/tegra-fuse
parent0bd9d3a6ae425b1ab2dc94f6f2323bf3fd5a2533 (diff)
misc: tegra-fuse: use devm_ for regulator
Use devm_regulator_get for the allocating regulator handle. This is managed resource and need not to free explictly and hence exit path is cleaned. Change-Id: I46872b677c63d64579b025579c1b68110db382f8 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/366957 Reviewed-by: Shardar Mohammed <smohammed@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/misc/tegra-fuse')
-rw-r--r--drivers/misc/tegra-fuse/tegra_fuse.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/misc/tegra-fuse/tegra_fuse.c b/drivers/misc/tegra-fuse/tegra_fuse.c
index f420c0c0e4da..aefa3fbcca44 100644
--- a/drivers/misc/tegra-fuse/tegra_fuse.c
+++ b/drivers/misc/tegra-fuse/tegra_fuse.c
@@ -954,7 +954,7 @@ int tegra_fuse_program(struct fuse_data *pgm_data, u32 flags)
}
#ifndef CONFIG_TEGRA_PRE_SILICON_SUPPORT
- if (IS_ERR_OR_NULL(fuse_regulator)) {
+ if (IS_ERR(fuse_regulator)) {
pr_err("fuse regulator is NULL");
return -ENODEV;
}
@@ -1212,7 +1212,7 @@ static int tegra_fuse_probe(struct platform_device *pdev)
{
#ifndef CONFIG_TEGRA_PRE_SILICON_SUPPORT
/* get fuse_regulator regulator */
- fuse_regulator = regulator_get(&pdev->dev, TEGRA_FUSE_SUPPLY);
+ fuse_regulator = devm_regulator_get(&pdev->dev, TEGRA_FUSE_SUPPLY);
if (IS_ERR(fuse_regulator))
pr_err("%s: no fuse_regulator. fuse write disabled\n",
__func__);
@@ -1221,12 +1221,6 @@ static int tegra_fuse_probe(struct platform_device *pdev)
clk_fuse = clk_get_sys("fuse-tegra", "fuse_burn");
if (IS_ERR(clk_fuse)) {
pr_err("%s: no clk_fuse. fuse read/write disabled\n", __func__);
-#ifndef CONFIG_TEGRA_PRE_SILICON_SUPPORT
- if (!IS_ERR_OR_NULL(fuse_regulator)) {
- regulator_put(fuse_regulator);
- fuse_regulator = NULL;
- }
-#endif
return -ENODEV;
}
@@ -1273,10 +1267,6 @@ static int tegra_fuse_remove(struct platform_device *pdev)
{
fuse_power_disable();
-#ifndef CONFIG_TEGRA_PRE_SILICON_SUPPORT
- if (!IS_ERR_OR_NULL(fuse_regulator))
- regulator_put(fuse_regulator);
-#endif
if (!IS_ERR_OR_NULL(clk_fuse))
clk_put(clk_fuse);