Re: [RFC PATCH v2 4/4] mmc: sdhci-cadence: fix the return value of sdhci_cdns_get_timeout_clock

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

 



Hi.


2017-02-27 17:29 GMT+09:00 Shawn Lin <shawn.lin@xxxxxxxxxxxxxx>:
> Return the timeout clock rate in Hz for sdhci core.
>
> Signed-off-by: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx>


I do not like the subject
"mmc: sdhci-cadence: fix the return value of sdhci_cdns_get_timeout_clock".

You are not fixing this driver,
but you are changing the API, right?

(More precisely, you are breaking it by 2/4, then fixing it by 4/4.
Right, you are fixing...)

Anyway, this would not be a problem because
Adrian requested to squash all the patches in this series.




> ---
>
> Changes in v2: None
>
>  drivers/mmc/host/sdhci-cadence.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
> index 316cfec..bb3951a 100644
> --- a/drivers/mmc/host/sdhci-cadence.c
> +++ b/drivers/mmc/host/sdhci-cadence.c
> @@ -103,9 +103,10 @@ static unsigned int sdhci_cdns_get_timeout_clock(struct sdhci_host *host)
>  {
>         /*
>          * Cadence's spec says the Timeout Clock Frequency is the same as the
> -        * Base Clock Frequency.  Divide it by 1000 to return a value in kHz.
> +        * Base Clock Frequency. Return a value in Hz per the requirement of
> +        * .get_timeout_clock callback.
>          */
> -       return host->max_clk / 1000;
> +       return DIV_ROUND_UP(DIV_ROUND_UP(host->max_clk, 1000), 1000);
>  }
>
>  static void sdhci_cdns_set_uhs_signaling(struct sdhci_host *host,


As Adrian pointed out, simply "return host->max_clk".

Also, please just remove the comment "Divide it by 1000 to return a
value in kHz."



-- 
Best Regards
Masahiro Yamada
--
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



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

  Powered by Linux