public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HSMMC: Fix boot crash on boards without gpio_cd set
@ 2008-11-14 19:45 Grazvydas Ignotas
  2008-11-14 19:45 ` [PATCH] HSMMC: Add MMC configuration for pandora Grazvydas Ignotas
  0 siblings, 1 reply; 7+ messages in thread
From: Grazvydas Ignotas @ 2008-11-14 19:45 UTC (permalink / raw)
  To: linux-omap; +Cc: Grazvydas Ignotas

If .gpio_cd is -EINVAL, twl_mmc_late_init() is not called and
hsmmc[x].mmc is not set, so don't use it in twl_mmc*_set_power().

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 0ea6ba6..626d668 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -239,6 +239,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 	u32 reg;
 	int ret = 0;
 	struct twl_mmc_controller *c = &hsmmc[0];
+	struct omap_mmc_platform_data *mmc = dev->platform_data;
 
 	if (power_on) {
 		if (cpu_is_omap2430()) {
@@ -250,7 +251,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 			omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
 		}
 
-		if (c->mmc->slots[0].internal_clock) {
+		if (mmc->slots[0].internal_clock) {
 			reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
 			reg |= OMAP2_MMCSDIO1ADPCLKISEL;
 			omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
@@ -293,11 +294,11 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vdd)
 {
 	int ret;
-
 	struct twl_mmc_controller *c = &hsmmc[1];
+	struct omap_mmc_platform_data *mmc = dev->platform_data;
 
 	if (power_on) {
-		if (c->mmc->slots[0].internal_clock) {
+		if (mmc->slots[0].internal_clock) {
 			u32 reg;
 
 			reg = omap_ctrl_readl(control_devconf1_offset);
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-11-14 22:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-14 19:45 [PATCH] HSMMC: Fix boot crash on boards without gpio_cd set Grazvydas Ignotas
2008-11-14 19:45 ` [PATCH] HSMMC: Add MMC configuration for pandora Grazvydas Ignotas
2008-11-14 20:11   ` David Brownell
2008-11-14 20:57     ` Grazvydas Ignotas
2008-11-14 21:40       ` Steve Sakoman
2008-11-14 22:35         ` David Brownell
2008-11-14 21:44       ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox