From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: imx@lists.linux.dev,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Fabio Estevam <festevam@gmail.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jiri Slaby <jirislaby@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-stm32@st-md-mailman.stormreply.com,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
linux-arm-kernel@lists.infradead.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
linux-serial@vger.kernel.org, Shawn Guo <shawnguo@kernel.org>,
Richard Genoud <richard.genoud@bootlin.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: mctrl_gpio: add parameter to skip sync
Date: Thu, 13 Feb 2025 14:42:54 +0100 [thread overview]
Message-ID: <64ec49f2-8c3b-4642-a910-32a656095c68@bootlin.com> (raw)
In-Reply-To: <2025021347-cling-smoked-9f28@gregkh>
Hello Greg,
On 2/13/25 10:58, Greg Kroah-Hartman wrote:
> On Thu, Feb 13, 2025 at 09:25:04AM +0100, Alexis Lothoré wrote:
[...]
>> - mctrl_gpio_disable_ms(up->gpios);
>> + mctrl_gpio_disable_ms(up->gpios, false);
>
> This a bad api.
>
> When you read this line in the driver, do you know what "false" means
> here?
>
> Please make two functions, mctrl_gpio_disable_ms_sync() and
> mctrl_gpio_disable_ms_no_sync() which can internally just call
> mctrl_gpio_disable_ms() with the boolean, but no driver should have to
> call that at all.
>
> That way, when you read driver code, you KNOW what is happening and you
> don't have to hunt around in a totally different C file to try to figure
> it out and loose your concentration.
Makes sense, I'll spin a v2 with a more explicit API.
Thanks,
Alexis
>
> thanks,
>
> greg k-h
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2025-02-13 13:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 8:25 [PATCH] serial: mctrl_gpio: add parameter to skip sync Alexis Lothoré
2025-02-13 9:58 ` Greg Kroah-Hartman
2025-02-13 13:42 ` Alexis Lothoré [this message]
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=64ec49f2-8c3b-4642-a910-32a656095c68@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=jirislaby@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=richard.genoud@bootlin.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=thomas.petazzoni@bootlin.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