Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 741cdecf authored by Lee Jones's avatar Lee Jones Committed by Samuel Ortiz
Browse files

mfd: db8500-prcmu: Return early if the TCPM cannot be located



Currently we check to see if we obtained the Tightly Coupled Program
Memory (TCPM) base and only execute the code within the check if we
have it. It's more traditional to return early if we don't have it.
This way we can flatten most of the function's code down to a single
tab spacing.

Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 5fb1c2dd
Loading
Loading
Loading
Loading
+21 −19
Original line number Diff line number Diff line
@@ -2704,6 +2704,7 @@ static void dbx500_fw_version_init(struct platform_device *pdev,
{
	struct resource *res;
	void __iomem *tcpm_base;
	u32 version;

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
					   "prcmu-tcpm");
@@ -2713,8 +2714,10 @@ static void dbx500_fw_version_init(struct platform_device *pdev,
		return;
	}
	tcpm_base = ioremap(res->start, resource_size(res));
	if (tcpm_base != NULL) {
		u32 version;
	if (!tcpm_base) {
		dev_err(&pdev->dev, "no prcmu tcpm mem region provided\n");
		return;
	}

	version = readl(tcpm_base + version_offset);
	fw_info.version.project = (version & 0xFF);
@@ -2733,7 +2736,6 @@ static void dbx500_fw_version_init(struct platform_device *pdev,
		fw_info.version.errata);
	iounmap(tcpm_base);
}
}

void __init db8500_prcmu_early_init(u32 phy_base, u32 size)
{