]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
reset: gpio: add the "compatible" property
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 21 Nov 2025 13:57:39 +0000 (14:57 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 8 Jan 2026 11:25:20 +0000 (12:25 +0100)
In order to correctly handle the interaction between the reset-gpio
devices and shared GPIOs managed by GPIOLIB, we need to be able to
identify the former. Add the "compatible" property to allow us to use
the device_is_compatible() helper.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/core.c

index 0135dd0ae20498396fdb5a682f913b6048cb5750..0666dfc41ca9af6fbf1768f17157b4faf7849962 100644 (file)
@@ -868,11 +868,11 @@ static int reset_add_gpio_aux_device(struct device *parent,
  */
 static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)
 {
-       struct property_entry properties[2] = { };
+       struct property_entry properties[3] = { };
        unsigned int offset, of_flags, lflags;
        struct reset_gpio_lookup *rgpio_dev;
        struct device *parent;
-       int id, ret;
+       int id, ret, prop = 0;
 
        /*
         * Currently only #gpio-cells=2 is supported with the meaning of:
@@ -923,7 +923,8 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)
 
        lflags = GPIO_PERSISTENT | (of_flags & GPIO_ACTIVE_LOW);
        parent = gpio_device_to_device(gdev);
-       properties[0] = PROPERTY_ENTRY_GPIO("reset-gpios", parent->fwnode, offset, lflags);
+       properties[prop++] = PROPERTY_ENTRY_STRING("compatible", "reset-gpio");
+       properties[prop++] = PROPERTY_ENTRY_GPIO("reset-gpios", parent->fwnode, offset, lflags);
 
        id = ida_alloc(&reset_gpio_ida, GFP_KERNEL);
        if (id < 0)