Skip to content

Commit d18fddf

Browse files
YueHaibinglinusw
authored andcommitted
gpiolib: Remove duplicated function gpio_do_set_config()
gpio_set_config() simply call gpio_do_set_config(), so remove the duplicated function. Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 8b844d7 commit d18fddf

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

drivers/gpio/gpiolib.c

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,34 +3058,15 @@ EXPORT_SYMBOL_GPL(gpiochip_free_own_desc);
30583058
* rely on gpio_request() having been called beforehand.
30593059
*/
30603060

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)
30633063
{
30643064
if (!gc->set_config)
30653065
return -ENOTSUPP;
30663066

30673067
return gc->set_config(gc, offset, mode);
30683068
}
30693069

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-
30893070
static int gpio_set_bias(struct gpio_chip *chip, struct gpio_desc *desc)
30903071
{
30913072
int bias = 0;
@@ -3319,7 +3300,7 @@ int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
33193300
chip = desc->gdev->chip;
33203301

33213302
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);
33233304
}
33243305
EXPORT_SYMBOL_GPL(gpiod_set_debounce);
33253306

@@ -3353,7 +3334,7 @@ int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
33533334
packed = pinconf_to_config_packed(PIN_CONFIG_PERSIST_STATE,
33543335
!transitory);
33553336
gpio = gpio_chip_hwgpio(desc);
3356-
rc = gpio_do_set_config(chip, gpio, packed);
3337+
rc = gpio_set_config(chip, gpio, packed);
33573338
if (rc == -ENOTSUPP) {
33583339
dev_dbg(&desc->gdev->dev, "Persistence not supported for GPIO %d\n",
33593340
gpio);

0 commit comments

Comments
 (0)