diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-07-23 18:55:14 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-08-07 16:44:55 +0300 |
commit | 7eb7ecddd3bdb9fd616bc62348ed3aaccaa9ef83 (patch) | |
tree | e5fb8058121aa11a7541ed8b19c42772cb3c05ee /drivers/pinctrl/intel | |
parent | cfc1c34585492179e9e74a0b64d1be285646be67 (diff) | |
download | linux-7eb7ecddd3bdb9fd616bc62348ed3aaccaa9ef83.tar.bz2 |
pinctrl: intel: Simplify offset validation in intel_get_padcfg()
There is more generic and simpler validation just against the nregs.
Using it allows to drop customization from the intel_get_padcfg().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pinctrl/intel')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-intel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 335b08d7d609..913c5dae773c 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -165,7 +165,7 @@ static void __iomem *intel_get_padcfg(struct intel_pinctrl *pctrl, padno = pin_to_padno(community, pin); nregs = (community->features & PINCTRL_FEATURE_DEBOUNCE) ? 4 : 2; - if (reg == PADCFG2 && !(community->features & PINCTRL_FEATURE_DEBOUNCE)) + if (reg >= nregs * 4) return NULL; return community->pad_regs + reg + padno * nregs * 4; |