Skip to content

Commit

Permalink
soc/tegra: fuse: Restore base on sysfs failure
Browse files Browse the repository at this point in the history
Make sure to also restore the register base address on sysfs
registration failure.

Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Thierry Reding committed Oct 16, 2019
1 parent c9e7537 commit 9f1022b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions drivers/soc/tegra/fuse/fuse-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 9f1022b

Please sign in to comment.