Skip to content

Commit b3d8508

Browse files
Bartosz GolaszewskipH5
authored andcommitted
reset: gpio: add the "compatible" property
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>
1 parent 8f0b4cc commit b3d8508

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/reset/core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,11 +868,11 @@ static int reset_add_gpio_aux_device(struct device *parent,
868868
*/
869869
static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)
870870
{
871-
struct property_entry properties[2] = { };
871+
struct property_entry properties[3] = { };
872872
unsigned int offset, of_flags, lflags;
873873
struct reset_gpio_lookup *rgpio_dev;
874874
struct device *parent;
875-
int id, ret;
875+
int id, ret, prop = 0;
876876

877877
/*
878878
* 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)
923923

924924
lflags = GPIO_PERSISTENT | (of_flags & GPIO_ACTIVE_LOW);
925925
parent = gpio_device_to_device(gdev);
926-
properties[0] = PROPERTY_ENTRY_GPIO("reset-gpios", parent->fwnode, offset, lflags);
926+
properties[prop++] = PROPERTY_ENTRY_STRING("compatible", "reset-gpio");
927+
properties[prop++] = PROPERTY_ENTRY_GPIO("reset-gpios", parent->fwnode, offset, lflags);
927928

928929
id = ida_alloc(&reset_gpio_ida, GFP_KERNEL);
929930
if (id < 0)

0 commit comments

Comments
 (0)