From: andy.shevchenko@gmail.com
To: Keguang Zhang <keguang.zhang@gmail.com>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Subject: Re: [PATCH 3/4] gpio: loongson1: Add DT support
Date: Wed, 22 Feb 2023 14:20:37 +0200 [thread overview]
Message-ID: <Y/YIlb8axBVVW3VV@surfacebook> (raw)
In-Reply-To: <20230222111213.2241633-4-keguang.zhang@gmail.com>
Wed, Feb 22, 2023 at 07:12:12PM +0800, Keguang Zhang kirjoitti:
> This patch adds DT support for Loongson-1 GPIO driver,
> including the following changes.
> - Add the of_match_table
> - Parse the ngpios property
> - Parse the alias id
Split!
...
> + if (of_property_read_u32(dn, "ngpios", &ngpios)) {
> + dev_err(dev, "Missing ngpios OF property\n");
> + return -ENODEV;
> + }
Why?! GPIO library has this already.
...
> + id = of_alias_get_id(dn, "gpio");
> + if (id < 0) {
> + dev_err(dev, "Couldn't get OF id\n");
> + return id;
> + }
What is this for?
...
> + ls1x_gc->gc.base = pdev->id * BITS_PER_LONG;
> - ls1x_gc->gc.base = pdev->id * 32;
No way. This is change makes me thing that initially it's simply wrong. Please,
just use -1 for the base.
...
> +static const struct of_device_id ls1x_gpio_dt_ids[] = {
> + { .compatible = "loongson,ls1x-gpio", },
Inner comma is not needed.
> + { /* sentinel */ }
> +};
You missed MODULE_DEVICE_TABLE().
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-02-22 12:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 11:12 [PATCH 0/4] Devicetree support for Loongson-1 GPIO Keguang Zhang
2023-02-22 11:12 ` [PATCH 1/4] gpio: loongson1: Update copyright Keguang Zhang
2023-02-22 12:17 ` andy.shevchenko
2023-03-02 11:09 ` Kelvin Cheung
2023-03-02 11:40 ` Krzysztof Kozlowski
2023-03-02 12:16 ` Kelvin Cheung
2023-03-02 19:02 ` Andy Shevchenko
2023-02-22 11:12 ` [PATCH 2/4] gpio: loongson1: Introduce ls1x_gpio_chip struct Keguang Zhang
2023-02-22 12:18 ` andy.shevchenko
2023-03-02 11:11 ` Kelvin Cheung
2023-02-22 11:12 ` [PATCH 3/4] gpio: loongson1: Add DT support Keguang Zhang
2023-02-22 12:20 ` andy.shevchenko [this message]
2023-03-02 11:08 ` Kelvin Cheung
2023-02-22 11:12 ` [PATCH 4/4] dt-bindings: gpio: Add Loongson-1 GPIO Keguang Zhang
2023-02-22 12:35 ` Krzysztof Kozlowski
2023-03-01 9:50 ` Kelvin Cheung
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=Y/YIlb8axBVVW3VV@surfacebook \
--to=andy.shevchenko@gmail.com \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=keguang.zhang@gmail.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=linux-mips@vger.kernel.org \
--cc=robh+dt@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 NNTP newsgroup(s).