@@ -3058,34 +3058,15 @@ EXPORT_SYMBOL_GPL(gpiochip_free_own_desc);
3058
3058
* rely on gpio_request() having been called beforehand.
3059
3059
*/
3060
3060
3061
- static int gpio_do_set_config (struct gpio_chip * gc , unsigned int offset ,
3062
- enum pin_config_param mode )
3061
+ static int gpio_set_config (struct gpio_chip * gc , unsigned int offset ,
3062
+ enum pin_config_param mode )
3063
3063
{
3064
3064
if (!gc -> set_config )
3065
3065
return - ENOTSUPP ;
3066
3066
3067
3067
return gc -> set_config (gc , offset , mode );
3068
3068
}
3069
3069
3070
- static int gpio_set_config (struct gpio_chip * gc , unsigned int offset ,
3071
- enum pin_config_param mode )
3072
- {
3073
- unsigned arg ;
3074
-
3075
- switch (mode ) {
3076
- case PIN_CONFIG_BIAS_DISABLE :
3077
- case PIN_CONFIG_BIAS_PULL_DOWN :
3078
- case PIN_CONFIG_BIAS_PULL_UP :
3079
- arg = 1 ;
3080
- break ;
3081
-
3082
- default :
3083
- arg = 0 ;
3084
- }
3085
-
3086
- return gpio_do_set_config (gc , offset , mode );
3087
- }
3088
-
3089
3070
static int gpio_set_bias (struct gpio_chip * chip , struct gpio_desc * desc )
3090
3071
{
3091
3072
int bias = 0 ;
@@ -3319,7 +3300,7 @@ int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
3319
3300
chip = desc -> gdev -> chip ;
3320
3301
3321
3302
config = pinconf_to_config_packed (PIN_CONFIG_INPUT_DEBOUNCE , debounce );
3322
- return gpio_do_set_config (chip , gpio_chip_hwgpio (desc ), config );
3303
+ return gpio_set_config (chip , gpio_chip_hwgpio (desc ), config );
3323
3304
}
3324
3305
EXPORT_SYMBOL_GPL (gpiod_set_debounce );
3325
3306
@@ -3353,7 +3334,7 @@ int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
3353
3334
packed = pinconf_to_config_packed (PIN_CONFIG_PERSIST_STATE ,
3354
3335
!transitory );
3355
3336
gpio = gpio_chip_hwgpio (desc );
3356
- rc = gpio_do_set_config (chip , gpio , packed );
3337
+ rc = gpio_set_config (chip , gpio , packed );
3357
3338
if (rc == - ENOTSUPP ) {
3358
3339
dev_dbg (& desc -> gdev -> dev , "Persistence not supported for GPIO %d\n" ,
3359
3340
gpio );
0 commit comments