From: Chuansheng Liu <chuansheng.liu@intel.com>
To: cjb@laptop.org, ohad@wizery.com
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
chuansheng.liu@intel.com
Subject: [PATCH] mmc,sdio: advancing the setting of dev name in mmc_sdio_init_card()
Date: Tue, 20 Nov 2012 01:38:23 +0800 [thread overview]
Message-ID: <1353346703.15558.1686.camel@cliu38-desktop-build> (raw)
In-Reply-To: <1353070447.15558.1681.camel@cliu38-desktop-build>
In below call trace:
mmc_rescan
-> mmc_rescan_try_freq()
-> mmc_attach_sdio()
-> mmc_sdio_init_card()
...
pm_runtime_set_active()
...
mmc_add_card()
The dev name is set until in mmc_add_card(), but before that, it is
possible the dev name is needed, for example in pm_runtime_set_active(),
we can call trace event to trace which dev is changing the runtime status.
So here advance it into mmc_sdio_init_card() to benefit others.
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
---
drivers/mmc/core/bus.c | 5 +++--
drivers/mmc/core/sdio.c | 5 ++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 9b68933..4884d6e 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -270,8 +270,9 @@ int mmc_add_card(struct mmc_card *card)
[UHS_DDR50_BUS_SPEED] = "DDR50 ",
};
-
- dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca);
+ if (!dev_name(&card->dev))
+ dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host),
+ card->rca);
switch (card->type) {
case MMC_TYPE_MMC:
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 2273ce6..a9f6f02 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -795,8 +795,11 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
goto remove;
}
finish:
- if (!oldcard)
+ if (!oldcard) {
host->card = card;
+ dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host),
+ card->rca);
+ }
return 0;
remove:
--
1.7.0.4
next prev parent reply other threads:[~2012-11-19 8:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-16 12:54 [PATCH] mmc,sdio: Fix the panic due to devname NULL when calling pm_runtime_set_active() Chuansheng Liu
2012-11-16 19:33 ` Ohad Ben-Cohen
2012-11-19 5:57 ` Liu, Chuansheng
2012-11-19 7:46 ` Ohad Ben-Cohen
2012-11-19 8:01 ` Liu, Chuansheng
2012-11-19 8:50 ` Ohad Ben-Cohen
2012-11-19 17:38 ` Chuansheng Liu [this message]
2012-11-19 8:51 ` [PATCH] mmc,sdio: advancing the setting of dev name in mmc_sdio_init_card() Huang Changming-R66093
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353346703.15558.1686.camel@cliu38-desktop-build \
--to=chuansheng.liu@intel.com \
--cc=cjb@laptop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ohad@wizery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®