Re: [PATCH v2 08/13] pinctrl: intel: Introduce for_each_requested_gpio() macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux