lkml.org 
[lkml]   [2023]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC
From


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

\
 
 \ /
  Last update: 2023-05-16 15:50    [W:0.167 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site