[PATCH v2 1/4] gpio: kunit: fix the label of the dummy GPIO chip

From: Bartosz Golaszewski

Date: Mon Oct 12 2026 - 10:46:53 EST


The label of the test GPIO provider is currently set to the consumer
name. Use the provider name instead.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
drivers/gpio/gpiolib-kunit.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpiolib-kunit.c b/drivers/gpio/gpiolib-kunit.c
index 90b7e77ef0b51f5115d8a3afe53060a8f33992d2..66095c7a3d4277c6cf6c5a39ba292b67ecc990e3 100644
--- a/drivers/gpio/gpiolib-kunit.c
+++ b/drivers/gpio/gpiolib-kunit.c
@@ -24,7 +24,6 @@
#define GPIO_PROBE_ORDER_TEST_CONSUMER "gpio-probe-order-test-consumer"
#define GPIO_PROBE_DEFER_TEST_CONSUMER "gpio-probe-defer-test-consumer"
#define GPIO_UNBIND_TEST_CONSUMER "gpio-unbind-test-consumer"
-#define GPIO_CONSUMER_NAME "gpio-swnode-consumer-test-device"

#define GPIO_TEST_PROVIDER_NGPIO 4

@@ -101,7 +100,7 @@ static int gpio_test_provider_probe(struct platform_device *pdev)

gc->base = -1;
gc->ngpio = GPIO_TEST_PROVIDER_NGPIO;
- gc->label = GPIO_CONSUMER_NAME;
+ gc->label = GPIO_TEST_PROVIDER;
gc->parent = dev;
gc->owner = THIS_MODULE;

@@ -780,7 +779,7 @@ static void gpio_hog_assert(struct kunit *test, unsigned int offset,

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

desc = gpio_device_get_desc(gdev, offset);

--
2.47.3