static int gpio_set_config(struct gpio_desc *desc, enum pin_config_param mode)
{
- unsigned int arg;
-
- switch (mode) {
- case PIN_CONFIG_BIAS_PULL_DOWN:
- case PIN_CONFIG_BIAS_PULL_UP:
- arg = 1;
- break;
-
- default:
- arg = 0;
- break;
- }
-
- return gpio_set_config_with_argument(desc, mode, arg);
+ return gpio_set_config_with_argument(desc, mode, 0);
}
static int gpio_set_bias(struct gpio_desc *desc)
{
enum pin_config_param bias;
+ unsigned int arg;
int ret;
if (test_bit(FLAG_BIAS_DISABLE, &desc->flags))
else
return 0;
- ret = gpio_set_config(desc, bias);
+ switch (bias) {
+ case PIN_CONFIG_BIAS_PULL_DOWN:
+ case PIN_CONFIG_BIAS_PULL_UP:
+ arg = 1;
+ break;
+
+ default:
+ arg = 0;
+ break;
+ }
+
+ ret = gpio_set_config_with_argument(desc, bias, arg);
if (ret != -ENOTSUPP)
return ret;