From: chenweilong <chenweilong@huawei.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <f.fangjian@huawei.com>, <yangyicong@hisilicon.com>,
<xuwei5@huawei.com>, <robh+dt@kernel.org>, <robh@kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>, <linux-gpio@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH next 1/2] gpio: hisi: Add initial device tree support
Date: Tue, 8 Nov 2022 19:17:32 +0800 [thread overview]
Message-ID: <33794563-ae4b-87e5-09df-d800268828f8@huawei.com> (raw)
In-Reply-To: <CACRpkdbfZoBsKhH-fDHbuiBMz=LuWJ5kRfRT9JupycJQLFzJZw@mail.gmail.com>
On 2022/11/8 18:33, Linus Walleij wrote:
> Hi Weilong,
>
> thanks for your patch!
>
> On Wed, Oct 26, 2022 at 5:34 AM Weilong Chen <chenweilong@huawei.com> wrote:
>
>> Add support for HiSilicon GPIO controller in embedded platform, which
>> boot from devicetree.
>>
>> Signed-off-by: Weilong Chen <chenweilong@huawei.com>
> I will provide OF comments, I let Andy and other ACPI experts say
> what is necessary for ACPI.
>
> (...)
>> +#include <linux/acpi.h>
> I don't know if this is necessary, check it.
>
>> #include <linux/gpio/driver.h>
>> #include <linux/module.h>
>> #include <linux/mod_devicetable.h>
>> +#include <linux/of.h>
> This is unnecessary for what you are trying to do. Drop it.
>
>> +#ifdef CONFIG_ACPI
>> static const struct acpi_device_id hisi_gpio_acpi_match[] = {
>> {"HISI0184", 0},
>> {}
>> };
>> MODULE_DEVICE_TABLE(acpi, hisi_gpio_acpi_match);
>> +#endif
> Don't know about this #ifdef, check if it is needed.
>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id hisi_gpio_dts_match[] = {
>> + { .compatible = "hisilicon,gpio-ascend910", },
>> + { }
>> +};
>> +MODULE_DEVICE_TABLE(of, hisi_gpio_dts_match);
>> +#endif
> Drop the ifdef, it is not needed.
>
>> static void hisi_gpio_get_pdata(struct device *dev,
>> struct hisi_gpio *hisi_gpio)
>> @@ -310,7 +322,8 @@ static int hisi_gpio_probe(struct platform_device *pdev)
>> static struct platform_driver hisi_gpio_driver = {
>> .driver = {
>> .name = HISI_GPIO_DRIVER_NAME,
>> - .acpi_match_table = hisi_gpio_acpi_match,
>> + .acpi_match_table = ACPI_PTR(hisi_gpio_acpi_match),
>> + .of_match_table = of_match_ptr(hisi_gpio_dts_match),
> Drop of_match_ptr() just assign it.
>
> The reason it works is because we put struct of_device_id into the generic
> headers so we can avoid the ifdefing.
>
> Yours,
> Linus Walleij
Thank for your review,I get it,and make improvements in subsequent patches.
Best regards,
Weilong Chen.
> .
prev parent reply other threads:[~2022-11-08 11:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 3:42 Weilong Chen
2022-10-26 3:42 ` [PATCH next 2/2] dt-bindings: gpio: add entry for hisilicon,gpio-ascend910 Weilong Chen
2022-10-26 14:46 ` Krzysztof Kozlowski
2022-10-27 7:47 ` chenweilong
2022-10-27 12:51 ` Krzysztof Kozlowski
2022-10-26 20:11 ` Rob Herring
2022-11-08 10:33 ` [PATCH next 1/2] gpio: hisi: Add initial device tree support Linus Walleij
2022-11-08 11:17 ` chenweilong [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=33794563-ae4b-87e5-09df-d800268828f8@huawei.com \
--to=chenweilong@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fangjian@huawei.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=xuwei5@huawei.com \
--cc=yangyicong@hisilicon.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
all inboxes | Powered by JetHome®