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>
This commit is contained in:
parent
c9e753767a
commit
9f1022b8bd
@ -146,20 +146,24 @@ static int tegra_fuse_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
if (fuse->soc->probe) {
|
if (fuse->soc->probe) {
|
||||||
err = fuse->soc->probe(fuse);
|
err = fuse->soc->probe(fuse);
|
||||||
if (err < 0) {
|
if (err < 0)
|
||||||
fuse->base = base;
|
goto restore;
|
||||||
return err;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tegra_fuse_create_sysfs(&pdev->dev, fuse->soc->info->size,
|
if (tegra_fuse_create_sysfs(&pdev->dev, fuse->soc->info->size,
|
||||||
fuse->soc->info))
|
fuse->soc->info)) {
|
||||||
return -ENODEV;
|
err = -ENODEV;
|
||||||
|
goto restore;
|
||||||
|
}
|
||||||
|
|
||||||
/* release the early I/O memory mapping */
|
/* release the early I/O memory mapping */
|
||||||
iounmap(base);
|
iounmap(base);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
restore:
|
||||||
|
fuse->base = base;
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver tegra_fuse_driver = {
|
static struct platform_driver tegra_fuse_driver = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user