linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter
@ 2014-12-05 10:41 Ulf Hansson
  2014-12-05 11:03 ` Dong Aisheng
  2014-12-05 18:10 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Ulf Hansson @ 2014-12-05 10:41 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Chris Ball
  Cc: Seungwon Jeon, Jaehoon Chung, Shawn Guo, Sascha Hauer,
	Aisheng Dong, Stephen Boyd, Minda Chen, Barry Song

To be able to use mmc_send_tuning() prior the struct mmc_card has been
allocated, let's convert it to take the struct mmc_host* as parameter
instead.

Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/core/mmc_ops.c | 7 +++----
 include/linux/mmc/core.h   | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 12b2a32..3b044c5 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -547,14 +547,13 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
 }
 EXPORT_SYMBOL_GPL(mmc_switch);
 
-int mmc_send_tuning(struct mmc_card *card)
+int mmc_send_tuning(struct mmc_host *host)
 {
 	struct mmc_request mrq = {NULL};
 	struct mmc_command cmd = {0};
 	struct mmc_data data = {0};
 	struct scatterlist sg;
-	struct mmc_host *mmc = card->host;
-	struct mmc_ios *ios = &mmc->ios;
+	struct mmc_ios *ios = &host->ios;
 	const u8 *tuning_block_pattern;
 	int size, err = 0;
 	u8 *data_buf;
@@ -596,7 +595,7 @@ int mmc_send_tuning(struct mmc_card *card)
 	data.sg_len = 1;
 	sg_init_one(&sg, data_buf, size);
 
-	mmc_wait_for_req(mmc, &mrq);
+	mmc_wait_for_req(host, &mrq);
 
 	if (cmd.error) {
 		err = cmd.error;
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index c4bdaa1..cb2b040 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -154,7 +154,7 @@ extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
 extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool,
 			bool, bool);
 extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
-extern int mmc_send_tuning(struct mmc_card *card);
+extern int mmc_send_tuning(struct mmc_host *host);
 extern int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
 
 #define MMC_ERASE_ARG		0x00000000
-- 
1.9.1


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

* Re: [PATCH] mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter
  2014-12-05 10:41 [PATCH] mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter Ulf Hansson
@ 2014-12-05 11:03 ` Dong Aisheng
  2014-12-05 18:10 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Dong Aisheng @ 2014-12-05 11:03 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, Chris Ball, Seungwon Jeon, Jaehoon Chung, Shawn Guo,
	Sascha Hauer, Stephen Boyd, Minda Chen, Barry Song

On Fri, Dec 05, 2014 at 11:41:23AM +0100, Ulf Hansson wrote:
> To be able to use mmc_send_tuning() prior the struct mmc_card has been
> allocated, let's convert it to take the struct mmc_host* as parameter
> instead.
> 
> Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Dong Aisheng <b29396@freescale.com>

Regards
Dong Aisheng

> ---
>  drivers/mmc/core/mmc_ops.c | 7 +++----
>  include/linux/mmc/core.h   | 2 +-
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
> index 12b2a32..3b044c5 100644
> --- a/drivers/mmc/core/mmc_ops.c
> +++ b/drivers/mmc/core/mmc_ops.c
> @@ -547,14 +547,13 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
>  }
>  EXPORT_SYMBOL_GPL(mmc_switch);
>  
> -int mmc_send_tuning(struct mmc_card *card)
> +int mmc_send_tuning(struct mmc_host *host)
>  {
>  	struct mmc_request mrq = {NULL};
>  	struct mmc_command cmd = {0};
>  	struct mmc_data data = {0};
>  	struct scatterlist sg;
> -	struct mmc_host *mmc = card->host;
> -	struct mmc_ios *ios = &mmc->ios;
> +	struct mmc_ios *ios = &host->ios;
>  	const u8 *tuning_block_pattern;
>  	int size, err = 0;
>  	u8 *data_buf;
> @@ -596,7 +595,7 @@ int mmc_send_tuning(struct mmc_card *card)
>  	data.sg_len = 1;
>  	sg_init_one(&sg, data_buf, size);
>  
> -	mmc_wait_for_req(mmc, &mrq);
> +	mmc_wait_for_req(host, &mrq);
>  
>  	if (cmd.error) {
>  		err = cmd.error;
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index c4bdaa1..cb2b040 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -154,7 +154,7 @@ extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
>  extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool,
>  			bool, bool);
>  extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
> -extern int mmc_send_tuning(struct mmc_card *card);
> +extern int mmc_send_tuning(struct mmc_host *host);
>  extern int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
>  
>  #define MMC_ERASE_ARG		0x00000000
> -- 
> 1.9.1
> 

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

* Re: [PATCH] mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter
  2014-12-05 10:41 [PATCH] mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter Ulf Hansson
  2014-12-05 11:03 ` Dong Aisheng
@ 2014-12-05 18:10 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2014-12-05 18:10 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc, Chris Ball
  Cc: Seungwon Jeon, Jaehoon Chung, Shawn Guo, Sascha Hauer,
	Aisheng Dong, Minda Chen, Barry Song

On 12/05/2014 02:41 AM, Ulf Hansson wrote:
> To be able to use mmc_send_tuning() prior the struct mmc_card has been
> allocated, let's convert it to take the struct mmc_host* as parameter
> instead.
>
> Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


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

end of thread, other threads:[~2014-12-05 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05 10:41 [PATCH] mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter Ulf Hansson
2014-12-05 11:03 ` Dong Aisheng
2014-12-05 18:10 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).