RE: [PATCH] mmc,sdio: advancing the setting of dev name in mmc_sdio_init_card()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is new version?
Maybe you should add prefix v2 in subject and the version history.

Best Regards
Jerry Huang


> -----Original Message-----
> From: linux-mmc-owner@xxxxxxxxxxxxxxx [mailto:linux-mmc-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Chuansheng Liu
> Sent: Tuesday, November 20, 2012 1:38 AM
> To: cjb@xxxxxxxxxx; ohad@xxxxxxxxxx
> Cc: linux-mmc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> chuansheng.liu@xxxxxxxxx
> Subject: [PATCH] mmc,sdio: advancing the setting of dev name in
> mmc_sdio_init_card()
> 
> 
> 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@xxxxxxxxx>
> ---
>  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
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

��.n��������+%������w��{.n�����{��i��)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux