linux-next: manual merge of the gpio-brgl tree with the origin tree

From: Mark Brown

Date: Wed Oct 21 2026 - 09:48:57 EST


Hi all,

Today's linux-next merge of the gpio-brgl tree got a conflict in:

drivers/gpio/gpiolib-kunit.c

between commit:

851bb4a429916 ("gpio: kunit: fix GPIO device reference leak with __free()")

from the origin tree and commit:

c3e8906112e0c ("gpio: kunit: factor out common code for waiting for device probe")

from the gpio-brgl tree.

I fixed it up (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.

diff --cc drivers/gpio/gpiolib-kunit.c
index 6a2c8b34f34bb,c5d4637ea2c58..0000000000000
--- a/drivers/gpio/gpiolib-kunit.c
+++ b/drivers/gpio/gpiolib-kunit.c
@@@ -27,9 -29,21 +29,23 @@@

#define GPIO_TEST_PROVIDER_NGPIO 4

+KUNIT_DEFINE_ACTION_WRAPPER(gpio_device_put_wrapper, gpio_device_put, struct gpio_device *);
+
+ static void gpio_test_device_check_bound(struct kunit *test,
+ struct device *dev, bool expected)
+ {
+ bool bound = false;
+
+ wait_for_device_probe();
+ scoped_guard(device, dev)
+ bound = device_is_bound(dev);
+
+ if (expected)
+ KUNIT_ASSERT_TRUE(test, bound);
+ else
+ KUNIT_ASSERT_FALSE(test, bound);
+ }
+
/*
* The test provider tracks per-line direction and value so that lines can be
* driven as both inputs and outputs - this is needed to exercise input as well
@@@ -772,9 -737,7 +739,8 @@@ static void gpio_hog_assert(struct kuni
struct property_entry properties[2];
struct platform_device *pdev;
struct fwnode_handle *fwnode;
+ struct gpio_device *gdev;
struct gpio_desc *desc;
- bool bound = true;
int ret;

fwnode = software_node_fwnode(&gpio_test_provider_swnode);
@@@ -792,12 -755,10 +758,12 @@@
wait_for_device_probe();

/* The hog must have configured the line with the expected direction. */
- gdev = gpio_device_find_by_label(GPIO_CONSUMER_NAME);
- struct gpio_device *gdev __free(gpio_device_put) =
- gpio_device_find_by_label(GPIO_TEST_PROVIDER);
++ gdev = gpio_device_find_by_label(GPIO_TEST_PROVIDER);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, gdev);

+ ret = kunit_add_action_or_reset(test, gpio_device_put_wrapper, gdev);
+ KUNIT_ASSERT_EQ(test, ret, 0);
+
desc = gpio_device_get_desc(gdev, offset);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, desc);

Attachment: signature.asc
Description: PGP signature