From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Bartosz Golaszewski <brgl@bgdev•pl>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro•org>,
Dan Carpenter <dan.carpenter@linaro•org>,
Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
Linux Next Mailing List <linux-next@vger•kernel.org>
Subject: linux-next: manual merge of the gpio-brgl tree with the gpio-brgl-fixes tree
Date: Mon, 3 Mar 2025 16:57:22 +1100 [thread overview]
Message-ID: <20250303165722.53c98069@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 3130 bytes --]
Hi all,
Today's linux-next merge of the gpio-brgl tree got a conflict in:
drivers/gpio/gpiolib.c
between commit:
64407f4b5807 ("gpiolib: Fix Oops in gpiod_direction_input_nonotify()")
from the gpio-brgl-fixes tree and commit:
e623c4303ed1 ("gpiolib: sanitize the return value of gpio_chip::get_direction()")
from the gpio-brgl tree.
I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging. You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/gpio/gpiolib.c
index 8741600af7ef,d0108cf2ee0b..000000000000
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@@ -2737,15 -2804,14 +2804,14 @@@ int gpiod_direction_input_nonotify(stru
* assume we are in input mode after this.
*/
if (guard.gc->direction_input) {
- ret = guard.gc->direction_input(guard.gc,
- gpio_chip_hwgpio(desc));
+ ret = gpiochip_direction_input(guard.gc,
+ gpio_chip_hwgpio(desc));
} else if (guard.gc->get_direction) {
- dir = guard.gc->get_direction(guard.gc,
- gpio_chip_hwgpio(desc));
- ret = gpiochip_get_direction(guard.gc, gpio_chip_hwgpio(desc));
- if (ret < 0)
- return ret;
++ dir = gpiochip_get_direction(guard.gc, gpio_chip_hwgpio(desc));
+ if (dir < 0)
+ return dir;
- if (ret != GPIO_LINE_DIRECTION_IN) {
+ if (dir != GPIO_LINE_DIRECTION_IN) {
gpiod_warn(desc,
"%s: missing direction_input() operation and line is output\n",
__func__);
@@@ -2762,9 -2828,30 +2828,30 @@@
return ret;
}
+ static int gpiochip_set(struct gpio_chip *gc, unsigned int offset, int value)
+ {
+ int ret;
+
+ lockdep_assert_held(&gc->gpiodev->srcu);
+
+ if (WARN_ON(unlikely(!gc->set && !gc->set_rv)))
+ return -EOPNOTSUPP;
+
+ if (gc->set_rv) {
+ ret = gc->set_rv(gc, offset, value);
+ if (ret > 0)
+ ret = -EBADE;
+
+ return ret;
+ }
+
+ gc->set(gc, offset, value);
+ return 0;
+ }
+
static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value)
{
- int val = !!value, ret = 0;
+ int val = !!value, ret = 0, dir;
CLASS(gpio_chip_guard, guard)(desc);
if (!guard.gc)
@@@ -2788,12 -2875,12 +2875,12 @@@
} else {
/* Check that we are in output mode if we can */
if (guard.gc->get_direction) {
- dir = guard.gc->get_direction(guard.gc,
- gpio_chip_hwgpio(desc));
- ret = gpiochip_get_direction(guard.gc,
++ dir = gpiochip_get_direction(guard.gc,
+ gpio_chip_hwgpio(desc));
- if (ret < 0)
- return ret;
+ if (dir < 0)
+ return dir;
- if (ret != GPIO_LINE_DIRECTION_OUT) {
+ if (dir != GPIO_LINE_DIRECTION_OUT) {
gpiod_warn(desc,
"%s: missing direction_output() operation\n",
__func__);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2025-03-03 5:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 5:57 Stephen Rothwell [this message]
2025-03-03 8:33 ` linux-next: manual merge of the gpio-brgl tree with the gpio-brgl-fixes tree Bartosz Golaszewski
-- strict thread matches above, loose matches on Subject: below --
2026-03-30 19:58 Mark Brown
2025-03-14 5:06 Stephen Rothwell
2025-03-14 9:57 ` Bartosz Golaszewski
2024-05-10 5:32 Stephen Rothwell
2024-05-10 6:33 ` Bartosz Golaszewski
2024-05-10 7:08 ` Stephen Rothwell
2024-05-10 7:10 ` Stephen Rothwell
2024-05-10 15:08 ` Andy Shevchenko
2023-10-19 5:06 Stephen Rothwell
2023-10-19 8:41 ` Bartosz Golaszewski
2021-01-20 2:51 Stephen Rothwell
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=20250303165722.53c98069@canb.auug.org.au \
--to=sfr@canb$(echo .)auug.org.au \
--cc=bartosz.golaszewski@linaro$(echo .)org \
--cc=brgl@bgdev$(echo .)pl \
--cc=dan.carpenter@linaro$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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