From: Viresh Kumar Date: Tue, 4 Jan 2011 17:55:14 +0000 (-0500) Subject: mmc: Register debugfs dir before calling card probe function. X-Git-Tag: v2.6.38-rc1~418^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a2727e98786136fb968b18d96f8ecdd9ba38aa8;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Tested-by: Chris Ball Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index af8dc6a..63667a8 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) type, card->rca); } - ret = device_add(&card->dev); - if (ret) - return ret; - #ifdef CONFIG_DEBUG_FS mmc_add_card_debugfs(card); #endif + ret = device_add(&card->dev); + if (ret) + return ret; + mmc_card_set_present(card); return 0;