aboutsummaryrefslogtreecommitdiff
path: root/drivers/soc/tegra
diff options
context:
space:
mode:
authorThierry Reding2019-08-20 15:53:44 +0200
committerThierry Reding2019-10-16 14:33:13 +0200
commit9f1022b8bd14ce937ca56174a97a1ce475c07693 (patch)
treeaf9f083fc040063fc89a3bc1b82cf1e91d874ba3 /drivers/soc/tegra
parentc9e753767a9c75d2044fb7343950a6a992d34a16 (diff)
soc/tegra: fuse: Restore base on sysfs failure
Make sure to also restore the register base address on sysfs registration failure. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc/tegra')
-rw-r--r--drivers/soc/tegra/fuse/fuse-tegra.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index 58996c6ea767..db516a2a3807 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -146,20 +146,24 @@ static int tegra_fuse_probe(struct platform_device *pdev)
if (fuse->soc->probe) {
err = fuse->soc->probe(fuse);
- if (err < 0) {
- fuse->base = base;
- return err;
- }
+ if (err < 0)
+ goto restore;
}
if (tegra_fuse_create_sysfs(&pdev->dev, fuse->soc->info->size,
- fuse->soc->info))
- return -ENODEV;
+ fuse->soc->info)) {
+ err = -ENODEV;
+ goto restore;
+ }
/* release the early I/O memory mapping */
iounmap(base);
return 0;
+
+restore:
+ fuse->base = base;
+ return err;
}
static struct platform_driver tegra_fuse_driver = {