All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiang Qiu <qiujiang@huawei.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Alan Tull <delicious.quinoa@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	linuxarm@huawei.com, haifeng.wei@huawei.com,
	charles.chenxin@huawei.com
Subject: Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode
Date: Fri, 11 Mar 2016 08:48:09 +0800	[thread overview]
Message-ID: <56E215C9.8030208@huawei.com> (raw)
In-Reply-To: <CAHp75VfGJZnOWUdZkjCbraupg=KUw2-jhtiRHLxrT2uUwJdvow@mail.gmail.com>

在 2016/3/11 4:27, Andy Shevchenko 写道:
> On Thu, Mar 10, 2016 at 9:09 PM, Alan Tull <delicious.quinoa@gmail.com> wrote:
>> On Fri, Mar 4, 2016 at 1:44 AM, qiujiang <qiujiang@huawei.com> wrote:
>>> This patch converts device node to fwnode in
>>> dwapb_port_property for designware gpio driver,
>>> so as to provide a unified data structure for DT
>>> and ACPI bindings.
>>>
>>> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>>> Signed-off-by: qiujiang <qiujiang@huawei.com>
>>> @@ -496,18 +492,19 @@ dwapb_gpio_get_pdata_of(struct device *dev)
>>>                  * Only port A can provide interrupts in all configurations of
>>>                  * the IP.
>>>                  */
>>> -               if (pp->idx == 0 &&
>>> -                   of_property_read_bool(port_np, "interrupt-controller")) {
>>> -                       pp->irq = irq_of_parse_and_map(port_np, 0);
>>> +               if (dev->of_node && pp->idx == 0 &&
>>> +                       of_property_read_bool(to_of_node(fwnode),
>>> +                               "interrupt-controller")) {
>> Hi Qiujiang,
>>
>> Is there a reason to use "of_property_read_bool" here instead of
>> "device_property_read_bool" or similar?
> Yeah, this patch looks unfinished.
>
> This should be
>      if (pp->idx == 0 &&  fwnode_property_read_bool(fwnode,
> "interrupt-controller")) {
Yes, agreed, "to_of_node" will never appear in this patch : )
>> Alan
>>
>>> +                       pp->irq = irq_of_parse_and_map(to_of_node(fwnode), 0);
> But here should be common method called which takes fwnode on input.
Agreed.
>
>>>                         if (!pp->irq) {
>>>                                 dev_warn(dev, "no irq for bank %s\n",
>>> -                                        port_np->full_name);
>>> +                                        to_of_node(fwnode)->full_name);
>>>                         }
>>>                 }
>>>
>>>                 pp->irq_shared  = false;
>>>                 pp->gpio_base   = -1;
>>> -               pp->name        = port_np->full_name;
>>> +               pp->name        = to_of_node(fwnode)->full_name;
> Also those two should be device property source agnostic. That's what
> I tried to tell earlier.
Agreed.
Thanks, Jiang

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Jiang Qiu <qiujiang@huawei.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Alan Tull <delicious.quinoa@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	<linuxarm@huawei.com>, <haifeng.wei@huawei.com>,
	<charles.chenxin@huawei.com>
Subject: Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode
Date: Fri, 11 Mar 2016 08:48:09 +0800	[thread overview]
Message-ID: <56E215C9.8030208@huawei.com> (raw)
In-Reply-To: <CAHp75VfGJZnOWUdZkjCbraupg=KUw2-jhtiRHLxrT2uUwJdvow@mail.gmail.com>

在 2016/3/11 4:27, Andy Shevchenko 写道:
> On Thu, Mar 10, 2016 at 9:09 PM, Alan Tull <delicious.quinoa@gmail.com> wrote:
>> On Fri, Mar 4, 2016 at 1:44 AM, qiujiang <qiujiang@huawei.com> wrote:
>>> This patch converts device node to fwnode in
>>> dwapb_port_property for designware gpio driver,
>>> so as to provide a unified data structure for DT
>>> and ACPI bindings.
>>>
>>> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>>> Signed-off-by: qiujiang <qiujiang@huawei.com>
>>> @@ -496,18 +492,19 @@ dwapb_gpio_get_pdata_of(struct device *dev)
>>>                  * Only port A can provide interrupts in all configurations of
>>>                  * the IP.
>>>                  */
>>> -               if (pp->idx == 0 &&
>>> -                   of_property_read_bool(port_np, "interrupt-controller")) {
>>> -                       pp->irq = irq_of_parse_and_map(port_np, 0);
>>> +               if (dev->of_node && pp->idx == 0 &&
>>> +                       of_property_read_bool(to_of_node(fwnode),
>>> +                               "interrupt-controller")) {
>> Hi Qiujiang,
>>
>> Is there a reason to use "of_property_read_bool" here instead of
>> "device_property_read_bool" or similar?
> Yeah, this patch looks unfinished.
>
> This should be
>      if (pp->idx == 0 &&  fwnode_property_read_bool(fwnode,
> "interrupt-controller")) {
Yes, agreed, "to_of_node" will never appear in this patch : )
>> Alan
>>
>>> +                       pp->irq = irq_of_parse_and_map(to_of_node(fwnode), 0);
> But here should be common method called which takes fwnode on input.
Agreed.
>
>>>                         if (!pp->irq) {
>>>                                 dev_warn(dev, "no irq for bank %s\n",
>>> -                                        port_np->full_name);
>>> +                                        to_of_node(fwnode)->full_name);
>>>                         }
>>>                 }
>>>
>>>                 pp->irq_shared  = false;
>>>                 pp->gpio_base   = -1;
>>> -               pp->name        = port_np->full_name;
>>> +               pp->name        = to_of_node(fwnode)->full_name;
> Also those two should be device property source agnostic. That's what
> I tried to tell earlier.
Agreed.
Thanks, Jiang

  reply	other threads:[~2016-03-11  0:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04  7:44 [PATCH v5 0/3] "gpio: designware: add gpio-signaled acpi event support for power button" qiujiang
2016-03-04  7:44 ` qiujiang
2016-03-04  7:44 ` [PATCH v5 1/3] gpio: designware: convert device node to fwnode qiujiang
2016-03-04  7:44   ` qiujiang
2016-03-10 19:09   ` Alan Tull
2016-03-10 20:27     ` Andy Shevchenko
2016-03-11  0:48       ` Jiang Qiu [this message]
2016-03-11  0:48         ` Jiang Qiu
2016-03-15 12:56       ` Jiang Qiu
2016-03-15 12:56         ` Jiang Qiu
2016-03-23 11:41       ` Jiang Qiu
2016-03-23 11:41         ` Jiang Qiu
2016-03-23 16:20         ` Alan Tull
2016-03-23 16:20           ` Alan Tull
2016-03-24  1:24           ` Jiang Qiu
2016-03-24  1:24             ` Jiang Qiu
2016-03-11  0:44     ` Jiang Qiu
2016-03-11  0:44       ` Jiang Qiu
2016-03-22 10:38   ` Linus Walleij
2016-03-22 15:55     ` Mika Westerberg
2016-03-04  7:44 ` [PATCH v5 2/3] gpio: designware: add acpi binding qiujiang
2016-03-04  7:44   ` qiujiang
2016-03-10 20:30   ` Andy Shevchenko
2016-03-04  7:44 ` [PATCH v5 3/3] gpio: designware: add gpio-signaled acpi event support qiujiang
2016-03-04  7:44   ` qiujiang
2016-03-10 20:31   ` Andy Shevchenko
2016-03-09  2:26 ` [PATCH v5 0/3] "gpio: designware: add gpio-signaled acpi event support for power button" Linus Walleij
2016-03-10 20:10   ` Alan Tull

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=56E215C9.8030208@huawei.com \
    --to=qiujiang@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=charles.chenxin@huawei.com \
    --cc=delicious.quinoa@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=haifeng.wei@huawei.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mika.westerberg@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.