gpiolib: fix gpio_do_set_config()

Commit d90f36851d ("gpiolib: have a single place of calling
set_config()") introduced a regression where we don't pass the right
variable as argument to the set_config() callback of gpio driver from
gpio_set_config(). After reverting two additional patches that came
on top of it - this addresses the issue by changing the type of the last
argument of gpio_do_set_config() to unsigned long and making sure the
packed config variable is actually used in gpio_set_config().

Fixes: d90f36851d ("gpiolib: have a single place of calling set_config()")
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Bartosz Golaszewski 2020-02-03 14:16:16 +01:00
parent 91b4ea5fc5
commit 62adc6f33d
1 changed files with 3 additions and 3 deletions

View File

@ -3036,12 +3036,12 @@ EXPORT_SYMBOL_GPL(gpiochip_free_own_desc);
*/
static int gpio_do_set_config(struct gpio_chip *gc, unsigned int offset,
enum pin_config_param mode)
unsigned long config)
{
if (!gc->set_config)
return -ENOTSUPP;
return gc->set_config(gc, offset, mode);
return gc->set_config(gc, offset, config);
}
static int gpio_set_config(struct gpio_chip *gc, unsigned int offset,
@ -3062,7 +3062,7 @@ static int gpio_set_config(struct gpio_chip *gc, unsigned int offset,
}
config = PIN_CONF_PACKED(mode, arg);
return gpio_do_set_config(gc, offset, mode);
return gpio_do_set_config(gc, offset, config);
}
static int gpio_set_bias(struct gpio_chip *chip, struct gpio_desc *desc)