linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Akhil R <akhilrajeev@nvidia.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Jon Hunter <jonathanh@nvidia.com>,
	Krishna Yarlagadda <kyarlagadda@nvidia.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-tegra <linux-tegra@vger.kernel.org>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Suresh Mangipudi <smangipudi@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [PATCH v2] gpio: tegra186: Add ACPI support
Date: Wed, 30 Jun 2021 19:14:10 +0300	[thread overview]
Message-ID: <CAHp75VdkC4vcOnC37D4iDZs3g=2K=+iTsXZX=20CK2Og6WtgPA@mail.gmail.com> (raw)
In-Reply-To: <1624288089-15278-1-git-send-email-akhilrajeev@nvidia.com>

On Mon, Jun 21, 2021 at 6:07 PM Akhil R <akhilrajeev@nvidia.com> wrote:

> >What about doing like
>
> >      gpio->secure = devm_platform_ioremap_resource_byname(pdev, "security");
> >      if (IS_ERR(gpio->secure))
> >              gpio->secure = devm_platform_ioremap_resource(pdev, 0);
> >      if (IS_ERR(gpio->secure))
> >              return PTR_ERR(gpio->secure);
> >
> >and similar for gpio->base?
>
> Wouldn't this cause a redundant check if it had already succeeded in getting
> the resource by name? Also, could it happen that if the device tree is
> incorrect, then one of the resource is fetched by name and other by the index,
> which I guess, would mess things up. Just my random thoughts, not sure if it
> is valid enough.
>
> >Wouldn't the following be enough?
> >
> >-       gpio->intc.name = pdev->dev.of_node->name;
> >+       gpio->intc.name = devm_kasprintf(&pdev->dev, "%pfw",
> >dev_fwnode(&pdev->dev));
> >+       if (!gpio->intc.name)
> >+
>
> How about this way? I feel it would be right to add the OF functions conditionally.

Looks okay, although I have a question here.

> +   if (pdev->dev.of_node) {

Do we really need this check at all? If the OF-node is NULL then it
doesn't matter if other fields are filled or not, correct?

What you need is #ifdef CONFIG_OF_GPIO (IIRC the name correctly).

> +       gpio->gpio.of_node = pdev->dev.of_node;
> +       gpio->gpio.of_gpio_n_cells = 2;
> +       gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
> +   }
>
> +   gpio->intc.name = gpio->soc->name;

-- 
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2021-06-30 16:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 10:05 [PATCH] " Akhil R
2021-06-17 14:54 ` Linus Walleij
2021-06-17 15:21 ` Andy Shevchenko
2021-06-18 13:39   ` [PATCH v2] " Akhil R
2021-06-18 14:31     ` Andy Shevchenko
2021-06-21 15:08       ` Akhil R
2021-06-29 15:17         ` Akhil R
2021-06-30 16:14         ` Andy Shevchenko [this message]
2021-06-30 17:47           ` Akhil R
2021-06-30 18:17             ` [PATCH v3] " Akhil R
2021-06-30 18:23               ` Andy Shevchenko
2021-07-01  5:01                 ` [PATCH v4] " Akhil R
2021-07-01  5:53                   ` Jon Hunter
2021-07-01  9:00                     ` [PATCH v5] " Akhil R
2021-07-08 13:08                       ` Jon Hunter
2021-07-16  8:31                       ` Bartosz Golaszewski
2021-07-19  4:46                         ` [PATCH v6] " Akhil R
2021-08-05 19:30                           ` Bartosz Golaszewski
2021-06-18 19:39 ` [PATCH] " kernel test robot

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='CAHp75VdkC4vcOnC37D4iDZs3g=2K=+iTsXZX=20CK2Og6WtgPA@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=akhilrajeev@nvidia.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=jonathanh@nvidia.com \
    --cc=kyarlagadda@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=smangipudi@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --subject='Re: [PATCH v2] gpio: tegra186: Add ACPI support' \
    /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

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 NNTP newsgroup(s).