Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645351

Re: [PATCH 2/2] mmc: core: Use device_property_read instead of of_property_read

From Ulf Hansson <ulf.hansson@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] mmc: core: Use device_property_read instead of of_property_read
Date 2017-05-19 10:30 +0200
Message-ID <tILsm-7S6-39@gated-at.bofh.it> (permalink)
References <tIfsu-AE-11@gated-at.bofh.it> <tIfsu-AE-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 18 May 2017 at 00:17, David Woods <dwoods@mellanox.com> wrote:
> Using the device_property interfaces allows mmc drivers to work
> on platforms which run on either device tree or ACPI.
>
> Signed-off-by: David Woods <dwoods@mellanox.com>
> Reviewed-by: Chris Metcalf <cmetcalf@mellanox.com>
> Cc: stable@vger.linux.org
> ---
>  drivers/mmc/core/host.c | 72 ++++++++++++++++++++++++-------------------------
>  1 file changed, 35 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 3f8c85d..d2c059e 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -176,19 +176,17 @@ static void mmc_retune_timer(unsigned long data)
>   */
>  int mmc_of_parse(struct mmc_host *host)
>  {
> -       struct device_node *np;
> +       struct device *dev = host->parent;
>         u32 bus_width;
>         int ret;
>         bool cd_cap_invert, cd_gpio_invert = false;
>         bool ro_cap_invert, ro_gpio_invert = false;
>
> -       if (!host->parent || !host->parent->of_node)
> +       if (!dev)
>                 return 0;
>

So earlier we stopped executing the OF parsing at this point, unless
we had valid a of_node pointer. To be safe, I think we need to do
something similar here.

In other words, perhaps check the result from dev_fwnode(), before continue.

[...]

mmc_pwrseq_alloc() is called from mmc_of_parse() which currently only
supports OF parsing. I assume you would like to convert that as well?
Perhaps that should even be the first step?

Kind regards
Uffe

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] mmc: core: Use device_property_read instead of of_property_read David Woods <dwoods@mellanox.com> - 2017-05-18 00:20 +0200
  Re: [PATCH 2/2] mmc: core: Use device_property_read instead of of_property_read Ulf Hansson <ulf.hansson@linaro.org> - 2017-05-19 10:30 +0200

csiph-web