summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-06-10 20:14:49 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-06-22 10:01:59 +0200
commitf3e7d2812247342c415c76ba75fd79df57ee2a74 (patch)
tree09209ae68ae91a4f772c028053ea59dc753b5b76 /drivers/pinctrl
parentpinctrl: intel: Make use of for_each_requested_gpio_in_range() (diff)
downloadlinux-f3e7d2812247342c415c76ba75fd79df57ee2a74.tar.xz
linux-f3e7d2812247342c415c76ba75fd79df57ee2a74.zip
pinctrl: lynxpoint: Make use of for_each_requested_gpio()
Make use of for_each_requested_gpio() instead of home grown analogue. 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
index a45b8f2182fd..2a3af998b91c 100644
--- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c
+++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
@@ -919,16 +919,17 @@ static int lp_gpio_runtime_resume(struct device *dev)
static int lp_gpio_resume(struct device *dev)
{
struct intel_pinctrl *lg = dev_get_drvdata(dev);
+ struct gpio_chip *chip = &lg->chip;
+ const char *dummy;
void __iomem *reg;
int i;
/* on some hardware suspend clears input sensing, re-enable it here */
- for (i = 0; i < lg->chip.ngpio; i++) {
- if (gpiochip_is_requested(&lg->chip, i) != NULL) {
- reg = lp_gpio_reg(&lg->chip, i, LP_CONFIG2);
- iowrite32(ioread32(reg) & ~GPINDIS_BIT, reg);
- }
+ for_each_requested_gpio(chip, i, dummy) {
+ reg = lp_gpio_reg(chip, i, LP_CONFIG2);
+ iowrite32(ioread32(reg) & ~GPINDIS_BIT, reg);
}
+
return 0;
}