Skip to content

Commit 6217728

Browse files
committed
pinctrl: intel: 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. Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 0a4cfed commit 6217728

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,6 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
677677
u32 term = 0, up = 0, value;
678678
void __iomem *padcfg1;
679679

680-
/* Set default strength value in case none is given */
681-
if (arg == 1)
682-
arg = 5000;
683-
684680
switch (param) {
685681
case PIN_CONFIG_BIAS_DISABLE:
686682
break;
@@ -690,6 +686,7 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
690686
case 20000:
691687
term = PADCFG1_TERM_20K;
692688
break;
689+
case 1: /* Set default strength value in case none is given */
693690
case 5000:
694691
term = PADCFG1_TERM_5K;
695692
break;
@@ -716,6 +713,7 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
716713
case 20000:
717714
term = PADCFG1_TERM_20K;
718715
break;
716+
case 1: /* Set default strength value in case none is given */
719717
case 5000:
720718
term = PADCFG1_TERM_5K;
721719
break;

0 commit comments

Comments
 (0)