From: jerome Neanne <jneanne@baylibre.com>
To: andy.shevchenko@gmail.com, Bartosz Golaszewski <brgl@bgdev.pl>
Cc: 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: Mon, 22 May 2023 09:47:43 +0200 [thread overview]
Message-ID: <9fa1a6e8-368a-3e22-aa84-8cad09f72a32@baylibre.com> (raw)
In-Reply-To: <ZGiWdQcR6Zq6Aw65@surfacebook>
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.
>
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 ???).
Thanks for your time.
next prev parent reply other threads:[~2023-05-22 7:51 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 [this message]
2023-05-22 11:18 ` Andy Shevchenko
2023-05-23 9:09 ` jerome Neanne
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=9fa1a6e8-368a-3e22-aa84-8cad09f72a32@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
all inboxes | Powered by JetHome®