[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a52e227-4f36-3766-7a1e-b2cc37a3657a@baylibre.com>
Date: Tue, 16 May 2023 15:49:16 +0200
From: jerome Neanne <jneanne@...libre.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Tony Lindgren <tony@...mide.com>, Lee Jones <lee@...nel.org>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-omap@...r.kernel.org,
Jonathan Cormier <jcormier@...ticallink.com>
Subject: Re: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC
On 15/05/2023 17:36, Bartosz Golaszewski wrote:
>> +static const struct gpio_chip tps65219_gpio_chip = {
>> + .label = "tps65219-gpio",
>> + .owner = THIS_MODULE,
>> + .get_direction = tps65219_gpio_get_direction,
>> + .direction_input = tps65219_gpio_direction_input,
>> + .direction_output = tps65219_gpio_direction_output,
>> + .get = tps65219_gpio_get,
>> + .set = tps65219_gpio_set,
>> + .base = -1,
>> + .ngpio = 3,
>> + .can_sleep = true,
>> +};
>> +
>> +static int tps65219_gpio_probe(struct platform_device *pdev)
>> +{
>> + struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);
>> + struct tps65219_gpio *gpio;
>> +
>> + gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
>> + if (!gpio)
>> + return -ENOMEM;
>> +
>> + gpio->tps = tps;
>> + gpio->gpio_chip = tps65219_gpio_chip;
>
> Aren't you getting any warnings here about dropping the 'const' from
> the global structure?
I tried a build with W=1 to check for warning I might have missed but
can't catch any here.
It's done in the exact same way in many other upstream drivers.
Anyway I can remove the const here if you think that could create
trouble at some point.
Just let me know your recommendation.
Regards,
Jerome
Powered by blists - more mailing lists