mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
soc/tegra: pmc: Don't fail if "aotag" is not present
The "aotog" is an optional aperture, so if that aperture is not defined for a given device, then initialise the 'aotag' pointer to NULL instead of returning an error. Note that the PMC driver will not use 'aotag' pointer if initialised to NULL. Co-developed-by: Shardar Mohammed <smohammed@nvidia.com> Signed-off-by: Shardar Mohammed <smohammed@nvidia.com> Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
committed by
Thierry Reding
parent
688dfe40b4
commit
1c458bbe4b
@@ -2897,9 +2897,16 @@ static int tegra_pmc_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(pmc->wake))
|
||||
return PTR_ERR(pmc->wake);
|
||||
|
||||
pmc->aotag = devm_platform_ioremap_resource_byname(pdev, "aotag");
|
||||
if (IS_ERR(pmc->aotag))
|
||||
return PTR_ERR(pmc->aotag);
|
||||
/* "aotag" is an optional aperture */
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||
"aotag");
|
||||
if (res) {
|
||||
pmc->aotag = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(pmc->aotag))
|
||||
return PTR_ERR(pmc->aotag);
|
||||
} else {
|
||||
pmc->aotag = NULL;
|
||||
}
|
||||
|
||||
/* "scratch" is an optional aperture */
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||
|
||||
Reference in New Issue
Block a user