Skip to content

Commit d563e7f

Browse files
tq-steinaBartosz Golaszewski
authored andcommitted
gpio: of: initialize local variable passed to the .of_xlate() callback
of_flags is passed down to GPIO chip's xlate function, so ensure this one is properly initialized as - if the xlate callback does nothing with it - we may end up with various configuration errors like: gpio-720 (enable): multiple pull-up, pull-down or pull-disable enabled, invalid configuration Signed-off-by: Alexander Stein <[email protected]> Link: https://lore.kernel.org/r/[email protected] [Bartosz: tweaked the commit message] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 30e0fd3 commit d563e7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpiolib-of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ struct gpio_desc *of_find_gpio(struct device_node *np, const char *con_id,
708708
unsigned int idx, unsigned long *flags)
709709
{
710710
char propname[32]; /* 32 is max size of property name */
711-
enum of_gpio_flags of_flags;
711+
enum of_gpio_flags of_flags = 0;
712712
const of_find_gpio_quirk *q;
713713
struct gpio_desc *desc;
714714

0 commit comments

Comments
 (0)