linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jerome Neanne <jneanne@baylibre.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
	Linus Walleij <linus.walleij@linaro.org>,
	Tony Lindgren <tony@atomide.com>, Lee Jones <lee@kernel.org>,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-omap@vger.kernel.org,
	Jonathan Cormier <jcormier@criticallink.com>
Subject: Re: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC
Date: Tue, 23 May 2023 11:09:51 +0200	[thread overview]
Message-ID: <0cf870f1-8cdb-df74-79d6-a4004cdfcc2f@baylibre.com> (raw)
In-Reply-To: <CAHp75Vf0hW6sMXeGSVXRVoW1mxFufWmbJNzt7_10xPj_k5SNkA@mail.gmail.com>



On 22/05/2023 13:18, Andy Shevchenko wrote:
> On Mon, May 22, 2023 at 10:47 AM jerome Neanne <jneanne@baylibre.com> wrote:
>> On 20/05/2023 11:44, andy.shevchenko@gmail.com wrote:
>>> Mon, May 15, 2023 at 05:36:46PM +0200, Bartosz Golaszewski kirjoitti:
>>>> On Thu, May 11, 2023 at 4:09 PM Jerome Neanne <jneanne@baylibre.com> wrote:
> 
> ...
> 
>>>>> +       gpio->gpio_chip = tps65219_gpio_chip;
>>>>
>>>> Aren't you getting any warnings here about dropping the 'const' from
>>>> the global structure?
>>>
>>> But this is a copy of the contents and not the simple pointer.
> 
> I commented on Bart's question.
> 
>> In many other places where this is done, the struct is declared like:
>>
>> static const struct gpio_chip template_chip = {
>>
>> After internal review, I changed this to:
>>
>> static const struct gpio_chip tps65219_gpio_chip = {
>>
>> This is because I didn't want to have this "template" that sounds to me
>> like "dummy". Maybe I misunderstood and this "template" was used on
>> purpose because this const struct is just copied once to initialize
>> tps65219_gpio->gpio_chip during probe.
>>
>> Introducing tps65219_gpio_chip name is maybe confusing with
>> tps65219_gpio struct.
>>
>> I think the const should not be a problem here but the naming I used
>> might be misleading. If you have a suggestion of what is a good practice
>> to make this piece of code clearer. I'll follow your suggestion (use
>> template? more_explicit name like ???).
> 
> It's up to Bart.
> 
Bart, should I keep the code like this or do you suggest a name change 
so that's it's more appealing?

  reply	other threads:[~2023-05-23  9:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 14:09 [PATCH v2 0/2] Add support for TI TPS65219 PMIC GPIO interface Jerome Neanne
2023-05-11 14:09 ` [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC Jerome Neanne
2023-05-11 20:57   ` Linus Walleij
2023-05-12  7:13     ` jerome Neanne
2023-05-17  6:33       ` Tony Lindgren
2023-05-22 12:26         ` jerome Neanne
2023-05-15 15:36   ` Bartosz Golaszewski
2023-05-16 13:49     ` jerome Neanne
2023-05-20  9:44     ` andy.shevchenko
2023-05-22  7:47       ` jerome Neanne
2023-05-22 11:18         ` Andy Shevchenko
2023-05-23  9:09           ` jerome Neanne [this message]
2023-05-26 13:31             ` Bartosz Golaszewski
2023-05-11 14:09 ` [PATCH v2 2/2] mfd: tps65219: Add gpio cell instance Jerome Neanne
2023-05-11 20:59   ` Linus Walleij

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=0cf870f1-8cdb-df74-79d6-a4004cdfcc2f@baylibre.com \
    --to=jneanne@baylibre.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=jcormier@criticallink.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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).