All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>, u-boot@lists.denx.de
Cc: peng.fan@nxp.com, faiz_abbas@ti.com, sjg@chromium.org,
	michael@walle.cc, git@xilinx.com, monstr@monstr.eu,
	somaashokreddy@gmail.com
Subject: Re: [PATCH v3 2/7] mmc: sdhci: Change prototype of set_delay to return errors
Date: Mon, 2 Aug 2021 08:09:09 +0900	[thread overview]
Message-ID: <69230e35-87cf-3e5c-ed5d-f2f26893ef00@samsung.com> (raw)
In-Reply-To: <20210730122842.3264-3-ashok.reddy.soma@xilinx.com>

On 7/30/21 9:28 PM, Ashok Reddy Soma wrote:
> set_delay() has return type as void. If there are any errors while
> setting tapdelay's it won't be able to return them.
> 
> Change the prototype of set_delay() in sdhci_ops structure and return
> the errors from wherever it is called.
> 
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>


Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
> 
> (no changes since v2)
> 
> Changes in v2:
>  - This is the second patch that has been split from 1/7
>  - This covers changes for sdhci driver separately
>  - Added a debug print in case of error from set_delay()
> 
>  drivers/mmc/sdhci.c | 10 ++++++++--
>  include/sdhci.h     |  2 +-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index d9ab6a0a83..a99014236a 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -366,6 +366,7 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
>  {
>  	struct sdhci_host *host = mmc->priv;
>  	unsigned int div, clk = 0, timeout;
> +	int ret;
>  
>  	/* Wait max 20 ms */
>  	timeout = 200;
> @@ -386,8 +387,13 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
>  	if (clock == 0)
>  		return 0;
>  
> -	if (host->ops && host->ops->set_delay)
> -		host->ops->set_delay(host);
> +	if (host->ops && host->ops->set_delay) {
> +		ret = host->ops->set_delay(host);
> +		if (ret) {
> +			printf("%s: Error while setting tap delay\n", __func__);
> +			return ret;
> +		}
> +	}
>  
>  	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
>  		/*
> diff --git a/include/sdhci.h b/include/sdhci.h
> index 0ae9471ad7..44a0d84e5a 100644
> --- a/include/sdhci.h
> +++ b/include/sdhci.h
> @@ -268,7 +268,7 @@ struct sdhci_ops {
>  	int	(*set_ios_post)(struct sdhci_host *host);
>  	void	(*set_clock)(struct sdhci_host *host, u32 div);
>  	int (*platform_execute_tuning)(struct mmc *host, u8 opcode);
> -	void (*set_delay)(struct sdhci_host *host);
> +	int (*set_delay)(struct sdhci_host *host);
>  	int	(*deferred_probe)(struct sdhci_host *host);
>  };
>  
> 


  reply	other threads:[~2021-08-01 23:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 12:28 [PATCH v3 0/7] Arasan sdhci driver updates Ashok Reddy Soma
2021-07-30 12:28 ` [PATCH v3 1/7] mmc: zynq_sdhci: Return errors from arasan_sdhci_set_tapdelay Ashok Reddy Soma
2021-08-01 23:08   ` Jaehoon Chung
2021-07-30 12:28 ` [PATCH v3 2/7] mmc: sdhci: Change prototype of set_delay to return errors Ashok Reddy Soma
2021-08-01 23:09   ` Jaehoon Chung [this message]
2021-07-30 12:28 ` [PATCH v3 3/7] zynqmp_firmware: Add zynqmp firmware related enums Ashok Reddy Soma
2021-07-30 12:28 ` [PATCH v3 4/7] mmc: zynq_sdhci: Add xilinx_pm_request() method to set tapdelays Ashok Reddy Soma
2021-07-30 12:28 ` [PATCH v3 5/7] mmc: zynq_sdhci: Move setting tapdelay code to driver Ashok Reddy Soma
2021-07-30 12:28 ` [PATCH v3 6/7] mmc: zynq_sdhci: Wait till sd card detect state is stable Ashok Reddy Soma
2021-07-30 12:28 ` [PATCH v3 7/7] mmc: zynq_sdhci: Use set_control_reg from sdhci.c Ashok Reddy Soma

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=69230e35-87cf-3e5c-ed5d-f2f26893ef00@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=ashok.reddy.soma@xilinx.com \
    --cc=faiz_abbas@ti.com \
    --cc=git@xilinx.com \
    --cc=michael@walle.cc \
    --cc=monstr@monstr.eu \
    --cc=peng.fan@nxp.com \
    --cc=sjg@chromium.org \
    --cc=somaashokreddy@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.