Patch "gpio: fix "gpio-line-names" property retrieval" has been added to the 4.14-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
gpio: fix "gpio-line-names" property retrieval
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
gpio-fix-gpio-line-names-property-retrieval.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
822703354774ec935169cbbc8d503236bcb54fdaMon Sep 17 00:00:00 2001
From: Christophe Leroy <[email protected]>
Date: Fri, 15 Dec 2017 15:02:33 +0100
Subject: gpio: fix "gpio-line-names" property retrieval
From: Christophe Leroy <[email protected]>
commit 822703354774ec935169cbbc8d503236bcb54fda upstream.
Following commit 9427ecbed46cc ("gpio: Rework of_gpiochip_set_names() to use device property accessors"), "gpio-line-names" DT property is not retrieved anymore when chip->parent is not set by the driver. This is due to OF based property reads having been replaced by device based property reads.
This patch fixes that by making use of fwnode_property_read_string_array() instead of device_property_read_string_array() and handing over either of_fwnode_handle(chip->of_node) or dev_fwnode(chip->parent) to that function.
--- drivers/gpio/gpiolib-acpi.c | 2 +- drivers/gpio/gpiolib-devprop.c | 17 +++++++---------- drivers/gpio/gpiolib-of.c | 3 ++- drivers/gpio/gpiolib.h | 3 ++- 4 files changed, 12 insertions(+), 13 deletions(-)
drivers/gpio/gpiolib-acpi.c +1 -1
@@ -1074,7 +1074,7 @@ void acpi_gpiochip_add(struct gpio_chip }if (!chip->names) -devprop_gpiochip_set_names (chip); +devprop_gpiochip_set_names (chip,dev_fwnode (chip->parent));acpi_gpiochip_request_regions (acpi_gpio);acpi_gpiochip_scan_gpios (acpi_gpio);
drivers/gpio/gpiolib-devprop.c +7 -10
@@ -19,30 +19,27 @@/** * devprop_gpiochip_set_names - Set GPIO line names using device properties * @chip: GPIO chip whose lines should be named, if possible +* @fwnode: Property Node containing the gpio-line-names property * * Looks for device property "gpio-line-names" and if it exists assigns * GPIO line names for the chip. The memory allocated for the assigned * names belong to the underlying firmware node and should not be released * by the caller. */ -void devprop_gpiochip_set_names (struct gpio_chip *chip) +void devprop_gpiochip_set_names (struct gpio_chip *chip, +const struct fwnode_handle *fwnode) {struct gpio_device *gdev = chip->gpiodev;const char **names;int ret, i; -if (!chip->parent) { -dev_warn (&gdev->dev,"GPIO chip parent is NULL\n" ); -return ; - } - - ret =device_property_read_string_array (chip->parent,"gpio-line-names" , + ret =fwnode_property_read_string_array (fwnode,"gpio-line-names" ,NULL ,0 );if (ret <0 )return ;if (ret != gdev->ngpio) { -dev_warn (chip->parent, +dev_warn (&gdev->dev,"names %d do not match number of GPIOs %d\n" , ret, gdev->ngpio);return ;
@@ -52,10 +49,10 @@ void devprop_gpiochip_set_names(struct gif (!names)return ; - ret =device_property_read_string_array (chip->parent,"gpio-line-names" , + ret =fwnode_property_read_string_array (fwnode,"gpio-line-names" , names, gdev->ngpio);if (ret <0 ) { -dev_warn (chip->parent,"failed to read GPIO line names\n" ); +dev_warn (&gdev->dev,"failed to read GPIO line names\n" );kfree (names);return ; }
drivers/gpio/gpiolib-of.c +2 -1
@@ -493,7 +493,8 @@ int of_gpiochip_add(struct gpio_chip *ch/* If the chip defines names itself, these take precedence */ if (!chip->names) -devprop_gpiochip_set_names (chip); +devprop_gpiochip_set_names (chip, +of_fwnode_handle (chip->of_node));of_node_get (chip->of_node);
drivers/gpio/gpiolib.h +2 -1
@@ -224,7 +224,8 @@ static inline int gpio_chip_hwgpio(constreturn desc - &desc->gdev->descs[0 ]; } -void devprop_gpiochip_set_names (struct gpio_chip *chip); +void devprop_gpiochip_set_names (struct gpio_chip *chip, +const struct fwnode_handle *fwnode);/* With descriptor prefix */
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/gpio-fix-gpio-line-names-property-retrieval.patch