[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D9LOD5X8NXF2.2GWBU2IAZESH7@bootlin.com>
Date: Fri, 02 May 2025 14:31:13 +0200
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@...tlin.com>
To: "Andy Shevchenko" <andriy.shevchenko@...el.com>
Cc: "Lee Jones" <lee@...nel.org>, "Rob Herring" <robh@...nel.org>,
"Krzysztof Kozlowski" <krzk+dt@...nel.org>, "Conor Dooley"
<conor+dt@...nel.org>, "Kamel Bouhara" <kamel.bouhara@...tlin.com>, "Linus
Walleij" <linus.walleij@...aro.org>, "Bartosz Golaszewski" <brgl@...ev.pl>,
"Dmitry Torokhov" <dmitry.torokhov@...il.com>,
Uwe Kleine-König <ukleinek@...nel.org>, "Michael Walle"
<mwalle@...nel.org>, "Mark Brown" <broonie@...nel.org>, "Greg
Kroah-Hartman" <gregkh@...uxfoundation.org>, "Rafael J. Wysocki"
<rafael@...nel.org>, "Danilo Krummrich" <dakr@...nel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-gpio@...r.kernel.org>, <linux-input@...r.kernel.org>,
<linux-pwm@...r.kernel.org>, Grégory Clement
<gregory.clement@...tlin.com>, "Thomas Petazzoni"
<thomas.petazzoni@...tlin.com>, "Bartosz Golaszewski"
<bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v7 08/11] gpio: max7360: Add MAX7360 gpio support
On Fri May 2, 2025 at 12:39 PM CEST, Andy Shevchenko wrote:
> On Mon, Apr 28, 2025 at 01:57:26PM +0200, Mathieu Dubois-Briand wrote:
>> +static int max7360_gpio_probe(struct platform_device *pdev)
>> +{
>> + const struct max7360_gpio_plat_data *plat_data;
>> + struct gpio_regmap_config gpio_config = { };
>> + struct regmap_irq_chip *irq_chip;
>> + struct device *dev = &pdev->dev;
>> + struct regmap *regmap;
>> + unsigned int outconf;
>> + int ret;
>> +
>> + regmap = dev_get_regmap(dev->parent, NULL);
>> + if (!regmap)
>> + return dev_err_probe(dev, -ENODEV, "could not get parent regmap\n");
>> +
>> + plat_data = device_get_match_data(dev);
>> + if (plat_data->function == MAX7360_GPIO_PORT) {
>> + if (device_property_read_bool(dev, "interrupt-controller")) {
>> + /*
>> + * Port GPIOs with interrupt-controller property: add IRQ
>> + * controller.
>> + */
>> + gpio_config.regmap_irq_flags = IRQF_ONESHOT | IRQF_SHARED;
>> + gpio_config.regmap_irq_line =
>> + fwnode_irq_get_byname(dev_fwnode(dev->parent), "inti");
>> + if (gpio_config.regmap_irq_line < 0)
>> + return dev_err_probe(dev, gpio_config.regmap_irq_line,
>> + "Failed to get IRQ\n");
>
>> + irq_chip = devm_kzalloc(dev, sizeof(*irq_chip), GFP_KERNEL);
>
> Can this be made static const instead?
>
Sorry, I don't think we can. We do have a few data that will vary:
->name, but above all ->irq_drv_data, as it will point on the regmap of
the specific device.
> ...
OK with all other comments.
Thanks for your review.
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists