From: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Gregor Herburger <gregor.herburger@tq-group.com>,
linux@ew.tq-group.com
Subject: Re: [PATCH 4/8] gpio: tqmx86: introduce _tqmx86_gpio_update_bits() helper
Date: Wed, 29 May 2024 14:25:42 +0200 [thread overview]
Message-ID: <9e4cfa2afe16c6b4dd5db425d8248592daa737c2.camel@ew.tq-group.com> (raw)
In-Reply-To: <28f4d8aa-917d-4666-b59d-bed3ebfab2e2@lunn.ch>
On Wed, 2024-05-29 at 14:19 +0200, Andrew Lunn wrote:
>
> On Wed, May 29, 2024 at 09:45:16AM +0200, Matthias Schiffer wrote:
> > Simplify a lot of code in the driver by introducing helpers for the
> > common RMW pattern. No tqmx86_gpio_update_bits() function with builtin
> > locking is added, as it would become redundant with the following fixes,
> > which further consolidate interrupt configuration register setup.
> >
> > No functional change intended.
> >
> > Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller")
> > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> > ---
> > drivers/gpio/gpio-tqmx86.c | 40 ++++++++++++++++++++++----------------
> > 1 file changed, 23 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c
> > index 613ab9ef2e744..7a851e1730dd1 100644
> > --- a/drivers/gpio/gpio-tqmx86.c
> > +++ b/drivers/gpio/gpio-tqmx86.c
> > @@ -54,6 +54,17 @@ static void tqmx86_gpio_write(struct tqmx86_gpio_data *gd, unsigned int reg,
> > iowrite8(val, gd->io_base + reg);
> > }
> >
> > +static void _tqmx86_gpio_update_bits(struct tqmx86_gpio_data *gd,
> > + unsigned int reg, u8 mask, u8 val)
>
> Why the _ prefix? This is a local function, it is static, so you don't
> have name space issues. Functions starting with _ are those you should
> not call without a good reason, there is generally a version without
> the _ prefix which is the real function to use. So i would drop the _.
My intention was to mark functions that need to be called while holding the spinlock with a _
prefix. Should I just remove the prefix and add a comment instead?
Matthias
>
> This is also not a fix. Please read:
>
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
>
> and stick to the rules described there.
>
> I don't know how the GPIO tree works, but for netdev, about a week
> after fixes are merged, they appear in net-next. So you can then build
> on top of them for development work.
>
> Andrew
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
next prev parent reply other threads:[~2024-05-29 12:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 7:45 [PATCH 0/8] gpio-tqmx86 fixes Matthias Schiffer
2024-05-29 7:45 ` [PATCH 1/8] gpio: tqmx86: fix typo in Kconfig label Matthias Schiffer
2024-05-29 11:58 ` Andrew Lunn
2024-05-29 7:45 ` [PATCH 2/8] gpio: tqmx86: introduce shadow register for GPIO output value Matthias Schiffer
2024-05-29 12:02 ` Andrew Lunn
2024-05-29 7:45 ` [PATCH 3/8] gpio: tqmx86: change tqmx86_gpio_write() order of arguments to match regmap API Matthias Schiffer
2024-05-29 12:03 ` Bartosz Golaszewski
2024-05-29 12:11 ` Andrew Lunn
2024-05-29 12:23 ` Matthias Schiffer
2024-05-29 7:45 ` [PATCH 4/8] gpio: tqmx86: introduce _tqmx86_gpio_update_bits() helper Matthias Schiffer
2024-05-29 12:19 ` Andrew Lunn
2024-05-29 12:25 ` Matthias Schiffer [this message]
2024-05-29 12:31 ` Andrew Lunn
2024-05-29 7:45 ` [PATCH 5/8] gpio: tqmx86: add macros for interrupt configuration Matthias Schiffer
2024-05-29 7:45 ` [PATCH 6/8] gpio: tqmx86: store IRQ triggers without offsetting index Matthias Schiffer
2024-05-29 7:45 ` [PATCH 7/8] gpio: tqmx86: store IRQ trigger type and unmask status separately Matthias Schiffer
2024-05-29 7:45 ` [PATCH 8/8] gpio: tqmx86: fix broken IRQ_TYPE_EDGE_BOTH interrupt type Matthias Schiffer
2024-05-29 12:37 ` Andrew Lunn
2024-05-29 12:44 ` Matthias Schiffer
2024-05-29 14:38 ` Dan Carpenter
2024-05-30 8:39 ` Matthias Schiffer
2024-05-30 10:22 ` Dan Carpenter
2024-05-30 11:15 ` Matthias Schiffer
2024-05-30 11:36 ` Matthias Schiffer
2024-05-30 12:13 ` Andrew Lunn
2024-05-29 12:08 ` [PATCH 0/8] gpio-tqmx86 fixes Bartosz Golaszewski
2024-05-29 12:54 ` Matthias Schiffer
2024-05-29 17:02 ` Bartosz Golaszewski
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=9e4cfa2afe16c6b4dd5db425d8248592daa737c2.camel@ew.tq-group.com \
--to=matthias.schiffer@ew.tq-group.com \
--cc=andrew@lunn.ch \
--cc=brgl@bgdev.pl \
--cc=gregor.herburger@tq-group.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@ew.tq-group.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®