Re: [PATCH 6/9] ARM: OMAP: Fix hsmmc init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 28, 2009 at 10:29:35AM -0800, Tony Lindgren wrote:
> It accidentally broke while changing the name for the driver
> to not to conflict with the other mmc driver.
> 
> Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>
> ---
>  arch/arm/plat-omap/devices.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
> index ac15c23..d22529c 100644
> --- a/arch/arm/plat-omap/devices.c
> +++ b/arch/arm/plat-omap/devices.c
> @@ -205,9 +205,15 @@ int __init omap_mmc_add(int id, unsigned long base, unsigned long size,
>  {
>  	struct platform_device *pdev;
>  	struct resource res[OMAP_MMC_NR_RES];
> +	char *name;
>  	int ret;
>  
> -	pdev = platform_device_alloc("mmci-omap", id);
> +	if (cpu_class_is_omap1() || cpu_is_omap242x())
> +		name = "mmci-omap";
> +	else
> +		name = "mmci-omap-hs";
> +
> +	pdev = platform_device_alloc(name, id);
>  	if (!pdev)
>  		return -ENOMEM;
>  

This is error prone.  I suggest instead:

int __init omap_mmc_add(const char *name, int id, unsigned long base,
		unsigned long size, unsigned int irq,
		struct omap_mmc_platform_data *data)

and moving that conditional up a level - OMAP1 not having it conditional,
and OMAP2 having the condition there along side the other in
omap2_init_mmc.

And, it's already in error.  Look at these two conditionals closely:

from plat-omap/devices.c:
+	if (cpu_class_is_omap1() || cpu_is_omap242x())
+		name = "mmci-omap";
+	else
+		name = "mmci-omap-hs";

and from mach-omap2/devices.c::omap2_init_mmc():
                if (cpu_is_omap2420())
                        size = OMAP2420_MMC_SIZE;
                else
                        size = HSMMC_SIZE;

These disagree about which CPUs have HSMMC and which don't.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux