diff mbox

[4/6] OMAP: mmc-twl4030 allow arbitrary slot names

Message ID 20090310093322.16889.39355.sendpatchset@ahunter-laptop (mailing list archive)
State Accepted
Commit 84a26c2ee36fc899901c08ec0458be1d4999e8b5
Headers show

Commit Message

Adrian Hunter March 10, 2009, 9:33 a.m. UTC
From 4c4a97595cab39443a85517c66bc26f5c2a9cae3 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Fri, 30 Jan 2009 11:10:19 +0200
Subject: [PATCH] OMAP: mmc-twl4030 allow arbitrary slot names

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |    5 ++++-
 arch/arm/mach-omap2/mmc-twl4030.h |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)

Comments

David Brownell March 10, 2009, 5:56 p.m. UTC | #1
On Tuesday 10 March 2009, Adrian Hunter wrote:
> >From 4c4a97595cab39443a85517c66bc26f5c2a9cae3 Mon Sep 17 00:00:00 2001
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Fri, 30 Jan 2009 11:10:19 +0200
> Subject: [PATCH] OMAP: mmc-twl4030 allow arbitrary slot names
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>

Acked-by: David Brownell <dbrownell@users.sourceforge.net>

Those current slot names are sort of useless, eh?

Actually the MMC framework itself is no help here.  If for
example "mmcblk0" always came from host "mmc0" names would
work a lot more smoothly.  Instead, "mmcblk0" comes from
the first card to be detected ... it might be from "mmc1"
on one boot, "mmc0" on the next, "mmc2" on a third boot.


> ---
>  arch/arm/mach-omap2/mmc-twl4030.c |    5 ++++-
>  arch/arm/mach-omap2/mmc-twl4030.h |    1 +
>  2 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> index a58deba..8fc8e84 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.c
> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> @@ -419,7 +419,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
>  			return;
>  		}
>  
> -		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> +		if (c->name)
> +			strncpy(twl->name, c->name, HSMMC_NAME_LEN);
> +		else
> +			sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
>  		mmc->slots[0].name = twl->name;
>  		mmc->nr_slots = 1;
>  		mmc->slots[0].wires = c->wires;
> diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
> index e87bc8d..69dbbc1 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.h
> +++ b/arch/arm/mach-omap2/mmc-twl4030.h
> @@ -15,6 +15,7 @@ struct twl4030_hsmmc_info {
>  	bool	cover_only;	/* No card detect - just cover switch */
>  	int	gpio_cd;	/* or -EINVAL */
>  	int	gpio_wp;	/* or -EINVAL */
> +	char	*name;		/* or NULL for default */
>  	struct device *dev;	/* returned: pointer to mmc adapter */
>  };
>  
> -- 
> 1.5.6.3
> 
> 



--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren March 10, 2009, 7:22 p.m. UTC | #2
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Commit: 84a26c2ee36fc899901c08ec0458be1d4999e8b5

PatchWorks
http://patchwork.kernel.org/patch/10842/

Git
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=84a26c2ee36fc899901c08ec0458be1d4999e8b5


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index a58deba..8fc8e84 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -419,7 +419,10 @@  void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 			return;
 		}
 
-		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
+		if (c->name)
+			strncpy(twl->name, c->name, HSMMC_NAME_LEN);
+		else
+			sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
 		mmc->slots[0].name = twl->name;
 		mmc->nr_slots = 1;
 		mmc->slots[0].wires = c->wires;
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index e87bc8d..69dbbc1 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -15,6 +15,7 @@  struct twl4030_hsmmc_info {
 	bool	cover_only;	/* No card detect - just cover switch */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	char	*name;		/* or NULL for default */
 	struct device *dev;	/* returned: pointer to mmc adapter */
 };