[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y/YIlb8axBVVW3VV@surfacebook>
Date:   Wed, 22 Feb 2023 14:20:37 +0200
From:   andy.shevchenko@...il.com
To:     Keguang Zhang <keguang.zhang@...il.com>
Cc:     linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Subject: Re: [PATCH 3/4] gpio: loongson1: Add DT support
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
Powered by blists - more mailing lists
 
