public inbox for linux-kernel@vger.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>,
	Jamie Iles <jamie@jamieiles.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	<linuxarm@huawei.com>, <haifeng.wei@huawei.com>,
	<charles.chenxin@huawei.com>, atull <atull@opensource.altera.com>
Subject: Re: [PATCH v6 1/2] gpio: dwapb: convert device node to fwnode
Date: Thu, 31 Mar 2016 08:51:29 +0800	[thread overview]
Message-ID: <56FC7491.5050000@huawei.com> (raw)
In-Reply-To: <CAHp75VcDAg_aXt7ej-_zXxHMXJohRM9ErQkJQS_ryekD-7V=zw@mail.gmail.com>

在 2016/3/30 19:38, Andy Shevchenko 写道:
> On Tue, Mar 29, 2016 at 7:30 PM, Alan Tull <delicious.quinoa@gmail.com> wrote:
>> On Fri, Mar 25, 2016 at 9:31 PM, qiujiang <qiujiang@huawei.com> wrote:
>>
>>> -               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 &&
>>> +                       fwnode_property_read_bool(fwnode,
>>> +                                                 "interrupt-controller")) {
>>> +                       pp->irq = irq_of_parse_and_map(to_of_node(fwnode), 0);
>>>                         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;
>>> +               if (dev->of_node)
>>> +                       pp->name = to_of_node(fwnode)->full_name;
>>
>> Hi Jiang,
>>
>> I tested lightly on a CycloneV and it worked fine (with device tree).
>>
>> One suggestion for both patches: you could remove name from struct
>> dwapb_port_property and get rid of pp->name and nobody would miss it.
>> All it is used for is some dev_err's so the device info gets printed
>> anyway.  For example (if I leave the irq out of the DT)
>>
>> gpio-dwapb ff708000.gpio: no irq for bank /soc/gpio@ff708000/gpio-controller@0
>>
>> is redundant.  The only additional info here from the name is the port
>> index.  That could be added to the messages without having to get the
>> name through the two property/of methods.
>>
> 
> Good suggestion! That'll make patches and code cleaner.
> 
> Perhaps separate prepended  patch?
> 
Hi Alan/Andy,

It sounds good, I will follow this suggestion and do a test. But, what's the
"separate prepended patch" mean?

Thanks, Jiang

  reply	other threads:[~2016-03-31  0:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-26  2:31 [PATCH v6 0/2] gpio: dwapb: add gpio-signaled acpi event support for power button qiujiang
2016-03-26  2:31 ` [PATCH v6 1/2] gpio: dwapb: convert device node to fwnode qiujiang
2016-03-29 16:30   ` Alan Tull
2016-03-30 11:38     ` Andy Shevchenko
2016-03-31  0:51       ` Jiang Qiu [this message]
2016-03-31 13:25         ` Andy Shevchenko
2016-03-26  2:31 ` [PATCH v6 2/2] gpio: dwapb: add gpio-signaled acpi event support qiujiang
2016-03-30 11:41   ` Andy Shevchenko
2016-03-31  0:59     ` Jiang Qiu

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=56FC7491.5050000@huawei.com \
    --to=qiujiang@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=atull@opensource.altera.com \
    --cc=charles.chenxin@huawei.com \
    --cc=delicious.quinoa@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=haifeng.wei@huawei.com \
    --cc=jamie@jamieiles.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox