diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-11-11 12:34:31 +0100 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-11-12 11:03:49 +0100 |
commit | d25dd66ae732f7752760d8f9306ba495de9dee8e (patch) | |
tree | 2318d9efcb74429477eaa0a82e173d56b160311a /drivers/pinctrl | |
parent | pinctrl: lynxpoint: Unify initcall location in the code (diff) | |
download | linux-d25dd66ae732f7752760d8f9306ba495de9dee8e.tar.xz linux-d25dd66ae732f7752760d8f9306ba495de9dee8e.zip |
pinctrl: lynxpoint: Use defined constant for disabled bias explicitly
We have a specific constant to describe a disabled bias,
i.e. GPIWP_NONE. Use it explicitly instead of making
an assumption about its value.
While at it, move argument assignment to the switch-case
in lp_pin_config_get().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-lynxpoint.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c index 849979d5d646..2e9670fc479a 100644 --- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c +++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c @@ -496,7 +496,7 @@ static int lp_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin, enum pin_config_param param = pinconf_to_config_param(*config); unsigned long flags; u32 value, pull; - u16 arg = 0; + u16 arg; raw_spin_lock_irqsave(&lg->lock, flags); value = ioread32(conf2); @@ -506,8 +506,9 @@ static int lp_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin, switch (param) { case PIN_CONFIG_BIAS_DISABLE: - if (pull) + if (pull != GPIWP_NONE) return -EINVAL; + arg = 0; break; case PIN_CONFIG_BIAS_PULL_DOWN: if (pull != GPIWP_DOWN) @@ -550,6 +551,7 @@ static int lp_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin, switch (param) { case PIN_CONFIG_BIAS_DISABLE: value &= ~GPIWP_MASK; + value |= GPIWP_NONE; break; case PIN_CONFIG_BIAS_PULL_DOWN: value &= ~GPIWP_MASK; |