Linux-mmc Archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Ben Dooks <ben-linux@fluff.org>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	 Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH v1 1/1] mmc: sdhci-s3c: Replace deprecated of_get_named_gpio()
Date: Mon, 25 Mar 2024 14:18:14 +0100	[thread overview]
Message-ID: <CAPDyKFpyF2OAQGP+RYmzYCh-ZFk+T+9w0A3AkJSdODEy5rHLJQ@mail.gmail.com> (raw)
In-Reply-To: <20240307121912.3676850-1-andriy.shevchenko@linux.intel.com>

On Thu, 7 Mar 2024 at 13:19, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> It seems the of_get_named_gpio() is solely used to check
> if the GPIO is present in DT as the function can return 0
> if and only if it's present and it becomes in the global
> number space 0. But this quite likely shows that the code
> wasn't ever been tested on the systems when no GPIO is provided.
> In any case, the proper test is just to call of_property_present()
> without any attempts in requesting GPIO (as we haven't saved the
> number or descriptor anywhere in the code).
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-s3c.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 0e8a8ac14e56..6493b0edba34 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -17,10 +17,8 @@
>  #include <linux/slab.h>
>  #include <linux/clk.h>
>  #include <linux/io.h>
> -#include <linux/gpio.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_gpio.h>
>  #include <linux/pm.h>
>  #include <linux/pm_runtime.h>
>
> @@ -446,7 +444,7 @@ static int sdhci_s3c_parse_dt(struct device *dev,
>                 return 0;
>         }
>
> -       if (of_get_named_gpio(node, "cd-gpios", 0))
> +       if (of_property_present(node, "cd-gpios"))
>                 return 0;
>
>         /* assuming internal card detect that will be configured by pinctrl */
> --
> 2.43.0.rc1.1.gbec44491f096
>

      parent reply	other threads:[~2024-03-25 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 12:19 [PATCH v1 1/1] mmc: sdhci-s3c: Replace deprecated of_get_named_gpio() Andy Shevchenko
2024-03-08 10:07 ` Adrian Hunter
2024-03-25 13:18 ` Ulf Hansson [this message]

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=CAPDyKFpyF2OAQGP+RYmzYCh-ZFk+T+9w0A3AkJSdODEy5rHLJQ@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ben-linux@fluff.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).