Skip to content

Commit 0a4cfed

Browse files
committed
pinctrl: tangier: Move default strength assignment to a switch-case
iWhen ->pin_config_set() is called from the GPIO library (assumed GpioIo() ACPI resource), the argument can be 1, when, for example, PullDefault is provided. In such case we supply sane default in the driver. Move that default assingment to a switch-case, so it will be consolidated in one place. Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Raag Jadav <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 2b9282a commit 0a4cfed

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/pinctrl/intel/pinctrl-tangier.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,11 @@ static int tng_config_set_pin(struct tng_pinctrl *tp, unsigned int pin,
368368
break;
369369

370370
case PIN_CONFIG_BIAS_PULL_UP:
371-
/* Set default strength value in case none is given */
372-
if (arg == 1)
373-
arg = 20000;
374-
375371
switch (arg) {
376372
case 50000:
377373
term = BUFCFG_PUPD_VAL_50K;
378374
break;
375+
case 1: /* Set default strength value in case none is given */
379376
case 20000:
380377
term = BUFCFG_PUPD_VAL_20K;
381378
break;
@@ -394,14 +391,11 @@ static int tng_config_set_pin(struct tng_pinctrl *tp, unsigned int pin,
394391
break;
395392

396393
case PIN_CONFIG_BIAS_PULL_DOWN:
397-
/* Set default strength value in case none is given */
398-
if (arg == 1)
399-
arg = 20000;
400-
401394
switch (arg) {
402395
case 50000:
403396
term = BUFCFG_PUPD_VAL_50K;
404397
break;
398+
case 1: /* Set default strength value in case none is given */
405399
case 20000:
406400
term = BUFCFG_PUPD_VAL_20K;
407401
break;

0 commit comments

Comments
 (0)