2020-11-25 03:40:46

by Jeremy Linton

[permalink] [raw]
Subject: [PATCH] mmc: sdhci: Use more concise device_property_read_u64

Since we only need a single u64 the _array form is
unnecessarily. Use device_property_read_u64 instead.

Signed-off-by: Jeremy Linton <[email protected]>
---
drivers/mmc/host/sdhci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index feba64fbde16..ad4ae88a7f74 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3992,10 +3992,10 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
if (host->v4_mode)
sdhci_do_enable_v4_mode(host);

- device_property_read_u64_array(mmc_dev(host->mmc),
- "sdhci-caps-mask", &dt_caps_mask, 1);
- device_property_read_u64_array(mmc_dev(host->mmc),
- "sdhci-caps", &dt_caps, 1);
+ device_property_read_u64(mmc_dev(host->mmc),
+ "sdhci-caps-mask", &dt_caps_mask);
+ device_property_read_u64(mmc_dev(host->mmc),
+ "sdhci-caps", &dt_caps);

v = ver ? *ver : sdhci_readw(host, SDHCI_HOST_VERSION);
host->version = (v & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
--
2.26.2


2020-11-25 08:11:38

by Adrian Hunter

[permalink] [raw]
Subject: Re: [PATCH] mmc: sdhci: Use more concise device_property_read_u64

On 25/11/20 5:36 am, Jeremy Linton wrote:
> Since we only need a single u64 the _array form is
> unnecessarily. Use device_property_read_u64 instead.
>
> Signed-off-by: Jeremy Linton <[email protected]>

Thank you :-)

Acked-by: Adrian Hunter <[email protected]>

> ---
> drivers/mmc/host/sdhci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index feba64fbde16..ad4ae88a7f74 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3992,10 +3992,10 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
> if (host->v4_mode)
> sdhci_do_enable_v4_mode(host);
>
> - device_property_read_u64_array(mmc_dev(host->mmc),
> - "sdhci-caps-mask", &dt_caps_mask, 1);
> - device_property_read_u64_array(mmc_dev(host->mmc),
> - "sdhci-caps", &dt_caps, 1);
> + device_property_read_u64(mmc_dev(host->mmc),
> + "sdhci-caps-mask", &dt_caps_mask);
> + device_property_read_u64(mmc_dev(host->mmc),
> + "sdhci-caps", &dt_caps);
>
> v = ver ? *ver : sdhci_readw(host, SDHCI_HOST_VERSION);
> host->version = (v & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
>

2020-12-04 14:42:47

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH] mmc: sdhci: Use more concise device_property_read_u64

On Wed, 25 Nov 2020 at 04:36, Jeremy Linton <[email protected]> wrote:
>
> Since we only need a single u64 the _array form is
> unnecessarily. Use device_property_read_u64 instead.
>
> Signed-off-by: Jeremy Linton <[email protected]>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/host/sdhci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index feba64fbde16..ad4ae88a7f74 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3992,10 +3992,10 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
> if (host->v4_mode)
> sdhci_do_enable_v4_mode(host);
>
> - device_property_read_u64_array(mmc_dev(host->mmc),
> - "sdhci-caps-mask", &dt_caps_mask, 1);
> - device_property_read_u64_array(mmc_dev(host->mmc),
> - "sdhci-caps", &dt_caps, 1);
> + device_property_read_u64(mmc_dev(host->mmc),
> + "sdhci-caps-mask", &dt_caps_mask);
> + device_property_read_u64(mmc_dev(host->mmc),
> + "sdhci-caps", &dt_caps);
>
> v = ver ? *ver : sdhci_readw(host, SDHCI_HOST_VERSION);
> host->version = (v & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
> --
> 2.26.2
>