[PATCH v3] arm/tegra: emc: convert tegra2_emc to a platform driver

Stephen Warren swarren at nvidia.com
Thu Jan 5 17:14:18 EST 2012


Olof Johansson wrote at Wednesday, January 04, 2012 11:01 PM:
> This is the first step in making it device-tree aware and get rid of the
> in-kernel EMC tables (of which there are none in mainline, thankfully).
> 
> Changes since v2:
> 
> * D'oh -- missed a couple of variables that were added, never used and then
>   later removed in a later patch.
> 
> Changes since v1:
> 
> * Fixed messed up indentation
> * Removed code that should be gone (was added here and removed later in series)
> 
> Signed-off-by: Olof Johansson <olof at lixom.net>
...
> diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
...
> +static int __devinit tegra_emc_probe(struct platform_device *pdev)
...
> +	if (!request_mem_region(res->start, resource_size(res), "tegra_emc")) {
> +		dev_err(&pdev->dev, "failed to request register region\n");
> +		return -EBUSY;
> +	}
> +
> +	emc_regbase = ioremap(res->start, resource_size(res));

Don't you need to error-check the ioremap() result, and undo the
request_mem_region() too? Or, use the devm variant to request the
region. The rest of the code checks emc_pdev!=NULL which won't detect
this failure.

Isn't there a get_resource && request && remap function now; I think I
recall a patch that wraps all that into one function, but it might have
been DT-only.

Otherwise,

Acked-by: Stephen Warren <swarren at nvidia.com>

-- 
nvpublic




More information about the linux-arm-kernel mailing list