Linux Samsung SOC development
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-s3c: Check if clk_set_rate() succeeds
@ 2013-08-29 16:15 Mark Brown
  2013-08-30  8:21 ` Jaehoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2013-08-29 16:15 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, linux-samsung-soc, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

It is possible that we may fail to set the clock rate, if we do so then
log the failure and don't bother reprogramming the IP.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/mmc/host/sdhci-s3c.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 926aaf6..d10de3f 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -295,6 +295,7 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
 	struct device *dev = &ourhost->pdev->dev;
 	unsigned long timeout;
 	u16 clk = 0;
+	int ret;
 
 	/* don't bother if the clock is going off */
 	if (clock == 0)
@@ -302,7 +303,12 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
 
 	sdhci_s3c_set_clock(host, clock);
 
-	clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
+	ret = clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
+	if (ret != 0) {
+		dev_err(dev, "%s: failed to set clock rate %uHz\n",
+			mmc_hostname(host->mmc), clock);
+		return;
+	}
 
 	host->clock = clock;
 
-- 
1.8.4.rc3


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

* Re: [PATCH] mmc: sdhci-s3c: Check if clk_set_rate() succeeds
  2013-08-29 16:15 [PATCH] mmc: sdhci-s3c: Check if clk_set_rate() succeeds Mark Brown
@ 2013-08-30  8:21 ` Jaehoon Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2013-08-30  8:21 UTC (permalink / raw)
  To: Mark Brown
  Cc: Chris Ball, linux-mmc, linux-samsung-soc, linaro-kernel,
	Mark Brown

Looks good to me.

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

On 08/30/2013 01:15 AM, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
> 
> It is possible that we may fail to set the clock rate, if we do so then
> log the failure and don't bother reprogramming the IP.
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>
> ---
>  drivers/mmc/host/sdhci-s3c.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 926aaf6..d10de3f 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -295,6 +295,7 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
>  	struct device *dev = &ourhost->pdev->dev;
>  	unsigned long timeout;
>  	u16 clk = 0;
> +	int ret;
>  
>  	/* don't bother if the clock is going off */
>  	if (clock == 0)
> @@ -302,7 +303,12 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
>  
>  	sdhci_s3c_set_clock(host, clock);
>  
> -	clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
> +	ret = clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
> +	if (ret != 0) {
> +		dev_err(dev, "%s: failed to set clock rate %uHz\n",
> +			mmc_hostname(host->mmc), clock);
> +		return;
> +	}
>  
>  	host->clock = clock;
>  
> 


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

* [PATCH] mmc: sdhci-s3c: Check if clk_set_rate() succeeds
@ 2013-12-12 11:21 Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-12-12 11:21 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, linaro-kernel, linux-samsung-soc, Mark Brown

From: Mark Brown <broonie@linaro.org>

It is possible that we may fail to set the clock rate, if we do so then
log the failure and don't bother reprogramming the IP.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/host/sdhci-s3c.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 6debda952155..5c20f827d828 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -295,6 +295,7 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
 	struct device *dev = &ourhost->pdev->dev;
 	unsigned long timeout;
 	u16 clk = 0;
+	int ret;
 
 	/* If the clock is going off, set to 0 at clock control register */
 	if (clock == 0) {
@@ -305,7 +306,12 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
 
 	sdhci_s3c_set_clock(host, clock);
 
-	clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
+	ret = clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
+	if (ret != 0) {
+		dev_err(dev, "%s: failed to set clock rate %uHz\n",
+			mmc_hostname(host->mmc), clock);
+		return;
+	}
 
 	host->clock = clock;
 
-- 
1.8.5.1


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

end of thread, other threads:[~2013-12-12 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 16:15 [PATCH] mmc: sdhci-s3c: Check if clk_set_rate() succeeds Mark Brown
2013-08-30  8:21 ` Jaehoon Chung
  -- strict thread matches above, loose matches on Subject: below --
2013-12-12 11:21 Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox