On Fri, Jun 12, 2020 at 05:50:01PM +0300, Andy Shevchenko wrote: > Introduce for_each_requested_gpio() macro which helps to iterate > over requested GPIO in a range. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> > --- > drivers/pinctrl/intel/pinctrl-intel.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/pinctrl/intel/pinctrl-intel.h b/drivers/pinctrl/intel/pinctrl-intel.h > index 4e17308d33e9..c1f312bc28eb 100644 > --- a/drivers/pinctrl/intel/pinctrl-intel.h > +++ b/drivers/pinctrl/intel/pinctrl-intel.h > @@ -249,4 +249,8 @@ const struct dev_pm_ops _name = { \ > intel_pinctrl_resume_noirq) \ > } > kernel-doc would be good to have here. > +#define for_each_requested_gpio(chip, i, base, size) \ > + for (i = 0; i < size; i++) \ > + if (!gpiochip_is_requested(chip, base + i)) {} else > + > #endif /* PINCTRL_INTEL_H */ > -- > 2.27.0.rc2