aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2011-01-04 12:55:14 -0500
committerChris Ball <cjb@laptop.org>2011-01-08 23:52:26 -0500
commit1a2727e98786136fb968b18d96f8ecdd9ba38aa8 (patch)
tree331427f7ba4fad1bb1d2cef6753f4c11b5ddba04
parentb37427b0a4e01ab5aaec1c9af7cef616ac4ce6d6 (diff)
mmc: Register debugfs dir before calling card probe function.
This way, the probe function may register debugfs files if it wants to. This fixes a bug with mmc_test where mmc_test_register_file_test() is called before the card's debugfs dir exists, and so it fails. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Tested-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/core/bus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index af8dc6a2a317..63667a8f140c 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -303,14 +303,14 @@ int mmc_add_card(struct mmc_card *card)
303 type, card->rca); 303 type, card->rca);
304 } 304 }
305 305
306 ret = device_add(&card->dev);
307 if (ret)
308 return ret;
309
310#ifdef CONFIG_DEBUG_FS 306#ifdef CONFIG_DEBUG_FS
311 mmc_add_card_debugfs(card); 307 mmc_add_card_debugfs(card);
312#endif 308#endif
313 309
310 ret = device_add(&card->dev);
311 if (ret)
312 return ret;
313
314 mmc_card_set_present(card); 314 mmc_card_set_present(card);
315 315
316 return 0; 316 return 0;