[PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers

Bartosz Golaszewski posted 1 patch 1 month ago
drivers/gpio/Kconfig | 34 ++++------------------------------
1 file changed, 4 insertions(+), 30 deletions(-)
[PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
Posted by Bartosz Golaszewski 1 month ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

None of the symbols exported in gpiolib-of.h are used by any of the GPIO
drivers we maintain. Even if they were, there are stubs for !OF_GPIO.
There's no reason for any of the drivers to depend at build-time on
GPIO_OF. We can drop all such cases.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/Kconfig | 34 ++++------------------------------
 1 file changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index e28efd5f9c17..652413e9c14c 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -134,7 +134,6 @@ menu "Memory mapped GPIO drivers"
 
 config GPIO_74XX_MMIO
 	tristate "GPIO driver for 74xx-ICs with MMIO access"
-	depends on OF_GPIO
 	select GPIO_GENERIC
 	help
 	  Say yes here to support GPIO functionality for 74xx-compatible ICs
@@ -148,7 +147,6 @@ config GPIO_74XX_MMIO
 
 config GPIO_ALTERA
 	tristate "Altera GPIO"
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	select OF_GPIO_MM_GPIOCHIP
 	help
@@ -192,7 +190,6 @@ config GPIO_ATH79
 config GPIO_RASPBERRYPI_EXP
 	tristate "Raspberry Pi 3 GPIO Expander"
 	default RASPBERRYPI_FIRMWARE
-	depends on OF_GPIO
 	# Make sure not 'y' when RASPBERRYPI_FIRMWARE is 'm'. This can only
 	# happen when COMPILE_TEST=y, hence the added !RASPBERRYPI_FIRMWARE.
 	depends on (ARCH_BCM2835 && RASPBERRYPI_FIRMWARE) || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE)
@@ -208,7 +205,7 @@ config GPIO_BCM_KONA
 
 config GPIO_BCM_XGS_IPROC
 	tristate "BRCM XGS iProc GPIO support"
-	depends on OF_GPIO && (ARCH_BCM_IPROC || COMPILE_TEST)
+	depends on ARCH_BCM_IPROC || COMPILE_TEST
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	default ARCH_BCM_IPROC
@@ -218,7 +215,7 @@ config GPIO_BCM_XGS_IPROC
 config GPIO_BRCMSTB
 	tristate "BRCMSTB GPIO support"
 	default y if (ARCH_BRCMSTB || BMIPS_GENERIC)
-	depends on OF_GPIO && (ARCH_BRCMSTB || ARCH_BCM2835 || BMIPS_GENERIC || COMPILE_TEST)
+	depends on ARCH_BRCMSTB || ARCH_BCM2835 || BMIPS_GENERIC || COMPILE_TEST
 	select GPIO_GENERIC
 	select IRQ_DOMAIN
 	help
@@ -226,7 +223,6 @@ config GPIO_BRCMSTB
 
 config GPIO_CADENCE
 	tristate "Cadence GPIO support"
-	depends on OF_GPIO
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	help
@@ -257,7 +253,6 @@ config GPIO_DWAPB
 config GPIO_EIC_SPRD
 	tristate "Spreadtrum EIC support"
 	depends on ARCH_SPRD || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	help
 	  Say yes here to support Spreadtrum EIC device.
@@ -306,7 +301,6 @@ config GPIO_GE_FPGA
 
 config GPIO_FTGPIO010
 	bool "Faraday FTGPIO010 GPIO"
-	depends on OF_GPIO
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	default (ARCH_GEMINI || ARCH_MOXART)
@@ -359,7 +353,6 @@ config GPIO_HISI
 
 config GPIO_HLWD
 	tristate "Nintendo Wii (Hollywood) GPIO"
-	depends on OF_GPIO
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	help
@@ -412,7 +405,6 @@ config GPIO_LOONGSON
 config GPIO_LOONGSON_64BIT
 	tristate "Loongson 64 bit GPIO support"
 	depends on LOONGARCH || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIO_GENERIC
 	help
 	  Say yes here to support the GPIO functionality of a number of
@@ -424,7 +416,7 @@ config GPIO_LOONGSON_64BIT
 config GPIO_LPC18XX
 	tristate "NXP LPC18XX/43XX GPIO support"
 	default y if ARCH_LPC18XX
-	depends on OF_GPIO && (ARCH_LPC18XX || COMPILE_TEST)
+	depends on ARCH_LPC18XX || COMPILE_TEST
 	select IRQ_DOMAIN_HIERARCHY
 	help
 	  Select this option to enable GPIO driver for
@@ -432,7 +424,7 @@ config GPIO_LPC18XX
 
 config GPIO_LPC32XX
 	tristate "NXP LPC32XX GPIO support"
-	depends on OF_GPIO && (ARCH_LPC32XX || COMPILE_TEST)
+	depends on ARCH_LPC32XX || COMPILE_TEST
 	help
 	  Select this option to enable GPIO driver for
 	  NXP LPC32XX devices.
@@ -477,7 +469,6 @@ config GPIO_MPC8XXX
 config GPIO_MT7621
 	bool "Mediatek MT7621 GPIO Support"
 	depends on SOC_MT7620 || SOC_MT7621 || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	help
@@ -562,7 +553,6 @@ config GPIO_RCAR
 config GPIO_RDA
 	bool "RDA Micro GPIO controller support"
 	depends on ARCH_RDA || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	help
@@ -612,7 +602,6 @@ config GPIO_RTD
 config GPIO_SAMA5D2_PIOBU
 	tristate "SAMA5D2 PIOBU GPIO support"
 	depends on MFD_SYSCON
-	depends on OF_GPIO
 	depends on ARCH_AT91 || COMPILE_TEST
 	select GPIO_SYSCON
 	help
@@ -624,7 +613,6 @@ config GPIO_SAMA5D2_PIOBU
 
 config GPIO_SIFIVE
 	tristate "SiFive GPIO support"
-	depends on OF_GPIO
 	select IRQ_DOMAIN_HIERARCHY
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
@@ -643,7 +631,6 @@ config GPIO_SIOX
 config GPIO_SNPS_CREG
 	bool "Synopsys GPIO via CREG (Control REGisters) driver"
 	depends on ARC || COMPILE_TEST
-	depends on OF_GPIO
 	help
 	  This driver supports GPIOs via CREG on various Synopsys SoCs.
 	  This is a single-register MMIO GPIO driver for complex cases
@@ -660,7 +647,6 @@ config GPIO_SPEAR_SPICS
 config GPIO_SPRD
 	tristate "Spreadtrum GPIO support"
 	depends on ARCH_SPRD || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	help
 	  Say yes here to support Spreadtrum GPIO device.
@@ -668,7 +654,6 @@ config GPIO_SPRD
 config GPIO_STP_XWAY
 	bool "XWAY STP GPIOs"
 	depends on SOC_XWAY || COMPILE_TEST
-	depends on OF_GPIO
 	help
 	  This enables support for the Serial To Parallel (STP) unit found on
 	  XWAY SoC. The STP allows the SoC to drive a shift registers cascade,
@@ -703,7 +688,6 @@ config GPIO_TEGRA
 	tristate "NVIDIA Tegra GPIO support"
 	default ARCH_TEGRA
 	depends on ARCH_TEGRA || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	select IRQ_DOMAIN_HIERARCHY
 	help
@@ -713,7 +697,6 @@ config GPIO_TEGRA186
 	tristate "NVIDIA Tegra186 GPIO support"
 	default ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC
 	depends on ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	select IRQ_DOMAIN_HIERARCHY
 	help
@@ -721,7 +704,6 @@ config GPIO_TEGRA186
 
 config GPIO_TS4800
 	tristate "TS-4800 DIO blocks and compatibles"
-	depends on OF_GPIO
 	depends on SOC_IMX51 || COMPILE_TEST
 	select GPIO_GENERIC
 	help
@@ -741,7 +723,6 @@ config GPIO_THUNDERX
 config GPIO_UNIPHIER
 	tristate "UniPhier GPIO support"
 	depends on ARCH_UNIPHIER || COMPILE_TEST
-	depends on OF_GPIO
 	select IRQ_DOMAIN_HIERARCHY
 	help
 	  Say yes here to support UniPhier GPIOs.
@@ -757,7 +738,6 @@ config GPIO_VF610
 config GPIO_VISCONTI
 	tristate "Toshiba Visconti GPIO support"
 	depends on ARCH_VISCONTI || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	select GPIO_GENERIC
 	select IRQ_DOMAIN_HIERARCHY
@@ -1071,7 +1051,6 @@ menu "I2C GPIO expanders"
 
 config GPIO_ADNP
 	tristate "Avionic Design N-bit GPIO expander"
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	help
 	  This option enables support for N GPIOs found on Avionic Design
@@ -1104,7 +1083,6 @@ config GPIO_DS4520
 
 config GPIO_GW_PLD
 	tristate "Gateworks PLD GPIO Expander"
-	depends on OF_GPIO
 	help
 	  Say yes here to provide access to the Gateworks I2C PLD GPIO
 	  Expander. This is used at least on the Cambria GW2358-4.
@@ -1466,7 +1444,6 @@ config GPIO_PALMAS
 config GPIO_PMIC_EIC_SPRD
 	tristate "Spreadtrum PMIC EIC support"
 	depends on MFD_SC27XX_PMIC || COMPILE_TEST
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	help
 	  Say yes here to support Spreadtrum PMIC EIC device.
@@ -1495,7 +1472,6 @@ config GPIO_SL28CPLD
 config GPIO_STMPE
 	bool "STMPE GPIOs"
 	depends on MFD_STMPE
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	help
 	  This enables support for the GPIOs found on the STMPE I/O
@@ -1504,7 +1480,6 @@ config GPIO_STMPE
 config GPIO_TC3589X
 	bool "TC3589X GPIOs"
 	depends on MFD_TC3589X
-	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
 	help
 	  This enables support for the GPIOs found on the TC3589X
@@ -1785,7 +1760,6 @@ menu "SPI GPIO expanders"
 
 config GPIO_74X164
 	tristate "74x164 serial-in/parallel-out 8-bits shift register"
-	depends on OF_GPIO
 	help
 	  Driver for 74x164 compatible serial-in/parallel-out 8-outputs
 	  shift registers. This driver can be used to provide access
-- 
2.45.2
Re: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
Posted by kernel test robot 4 weeks, 1 day ago
Hi Bartosz,

kernel test robot noticed the following build errors:

[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.12-rc4 next-20241025]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpio-relax-the-Kconfig-dependency-on-OF_GPIO-in-drivers/20241025-032925
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20241024192758.91748-1-brgl%40bgdev.pl
patch subject: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
config: sh-randconfig-r052-20241027 (https://download.01.org/0day-ci/archive/20241027/202410270419.5ZWOyqMq-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241027/202410270419.5ZWOyqMq-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410270419.5ZWOyqMq-lkp@intel.com/

All errors (new ones prefixed by >>):

   sh4-linux-ld: drivers/gpio/gpio-altera.o: in function `altera_gpio_remove':
>> gpio-altera.c:(.text+0x20): undefined reference to `of_mm_gpiochip_remove'
   sh4-linux-ld: drivers/gpio/gpio-altera.o: in function `altera_gpio_probe':
>> gpio-altera.c:(.text+0x544): undefined reference to `of_mm_gpiochip_add_data'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
Posted by kernel test robot 1 month ago
Hi Bartosz,

kernel test robot noticed the following build errors:

[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.12-rc4 next-20241025]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpio-relax-the-Kconfig-dependency-on-OF_GPIO-in-drivers/20241025-032925
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20241024192758.91748-1-brgl%40bgdev.pl
patch subject: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
config: m68k-randconfig-r051-20241026 (https://download.01.org/0day-ci/archive/20241027/202410270016.f3oIhZ0P-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241027/202410270016.f3oIhZ0P-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410270016.f3oIhZ0P-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/gpio/gpio-brcmstb.c: In function 'brcmstb_gpio_of_xlate':
>> drivers/gpio/gpio-brcmstb.c:406:15: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     406 |         if (gc->of_gpio_n_cells != 2) {
         |               ^~
   In file included from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/m68k/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:79,
                    from include/linux/spinlock.h:56,
                    from include/linux/irq.h:14,
                    from include/linux/irqchip/chained_irq.h:10,
                    from include/linux/gpio/driver.h:8,
                    from drivers/gpio/gpio-brcmstb.c:5:
   drivers/gpio/gpio-brcmstb.c:411:46: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     411 |         if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
         |                                              ^~
   include/asm-generic/bug.h:123:32: note: in definition of macro 'WARN_ON'
     123 |         int __ret_warn_on = !!(condition);                              \
         |                                ^~~~~~~~~
   drivers/gpio/gpio-brcmstb.c: In function 'brcmstb_gpio_probe':
   drivers/gpio/gpio-brcmstb.c:689:19: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     689 |                 gc->of_gpio_n_cells = 2;
         |                   ^~
>> drivers/gpio/gpio-brcmstb.c:690:19: error: 'struct gpio_chip' has no member named 'of_xlate'
     690 |                 gc->of_xlate = brcmstb_gpio_of_xlate;
         |                   ^~
--
   drivers/gpio/gpio-lpc32xx.c: In function 'lpc32xx_gpio_probe':
>> drivers/gpio/gpio-lpc32xx.c:517:49: error: 'struct gpio_chip' has no member named 'of_xlate'
     517 |                         lpc32xx_gpiochip[i].chip.of_xlate = lpc32xx_of_xlate;
         |                                                 ^
>> drivers/gpio/gpio-lpc32xx.c:518:49: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     518 |                         lpc32xx_gpiochip[i].chip.of_gpio_n_cells = 3;
         |                                                 ^
--
   drivers/gpio/gpio-mt7621.c: In function 'mediatek_gpio_bank_probe':
>> drivers/gpio/gpio-mt7621.c:246:17: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     246 |         rg->chip.of_gpio_n_cells = 2;
         |                 ^
>> drivers/gpio/gpio-mt7621.c:247:17: error: 'struct gpio_chip' has no member named 'of_xlate'
     247 |         rg->chip.of_xlate = mediatek_gpio_xlate;
         |                 ^
--
   In file included from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/m68k/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:79,
                    from include/linux/spinlock.h:56,
                    from include/linux/irq.h:14,
                    from include/linux/irqchip/chained_irq.h:10,
                    from include/linux/gpio/driver.h:8,
                    from drivers/gpio/gpio-tegra186.c:9:
   drivers/gpio/gpio-tegra186.c: In function 'tegra186_gpio_of_xlate':
>> drivers/gpio/gpio-tegra186.c:469:25: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     469 |         if (WARN_ON(chip->of_gpio_n_cells < 2))
         |                         ^~
   include/asm-generic/bug.h:123:32: note: in definition of macro 'WARN_ON'
     123 |         int __ret_warn_on = !!(condition);                              \
         |                                ^~~~~~~~~
   drivers/gpio/gpio-tegra186.c:472:44: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     472 |         if (WARN_ON(spec->args_count < chip->of_gpio_n_cells))
         |                                            ^~
   include/asm-generic/bug.h:123:32: note: in definition of macro 'WARN_ON'
     123 |         int __ret_warn_on = !!(condition);                              \
         |                                ^~~~~~~~~
   drivers/gpio/gpio-tegra186.c: In function 'tegra186_gpio_irq_domain_translate':
   drivers/gpio/gpio-tegra186.c:676:31: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     676 |         if (WARN_ON(gpio->gpio.of_gpio_n_cells < 2))
         |                               ^
   include/asm-generic/bug.h:123:32: note: in definition of macro 'WARN_ON'
     123 |         int __ret_warn_on = !!(condition);                              \
         |                                ^~~~~~~~~
   drivers/gpio/gpio-tegra186.c:679:53: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     679 |         if (WARN_ON(fwspec->param_count < gpio->gpio.of_gpio_n_cells))
         |                                                     ^
   include/asm-generic/bug.h:123:32: note: in definition of macro 'WARN_ON'
     123 |         int __ret_warn_on = !!(condition);                              \
         |                                ^~~~~~~~~
   drivers/gpio/gpio-tegra186.c: At top level:
>> drivers/gpio/gpio-tegra186.c:462:12: warning: 'tegra186_gpio_of_xlate' defined but not used [-Wunused-function]
     462 | static int tegra186_gpio_of_xlate(struct gpio_chip *chip,
         |            ^~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [y]:
   - RESOURCE_KUNIT_TEST [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y]


vim +406 drivers/gpio/gpio-brcmstb.c

3b0213d56eb7f7 Gregory Fong  2015-05-28  398  
3b0213d56eb7f7 Gregory Fong  2015-05-28  399  static int brcmstb_gpio_of_xlate(struct gpio_chip *gc,
3b0213d56eb7f7 Gregory Fong  2015-05-28  400  		const struct of_phandle_args *gpiospec, u32 *flags)
3b0213d56eb7f7 Gregory Fong  2015-05-28  401  {
3b0213d56eb7f7 Gregory Fong  2015-05-28  402  	struct brcmstb_gpio_priv *priv = brcmstb_gpio_gc_to_priv(gc);
0f4630f3720e7e Linus Walleij 2015-12-04  403  	struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
3b0213d56eb7f7 Gregory Fong  2015-05-28  404  	int offset;
3b0213d56eb7f7 Gregory Fong  2015-05-28  405  
3b0213d56eb7f7 Gregory Fong  2015-05-28 @406  	if (gc->of_gpio_n_cells != 2) {
3b0213d56eb7f7 Gregory Fong  2015-05-28  407  		WARN_ON(1);
3b0213d56eb7f7 Gregory Fong  2015-05-28  408  		return -EINVAL;
3b0213d56eb7f7 Gregory Fong  2015-05-28  409  	}
3b0213d56eb7f7 Gregory Fong  2015-05-28  410  
3b0213d56eb7f7 Gregory Fong  2015-05-28  411  	if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
3b0213d56eb7f7 Gregory Fong  2015-05-28  412  		return -EINVAL;
3b0213d56eb7f7 Gregory Fong  2015-05-28  413  
ec37529e544c59 Doug Berger   2024-04-23  414  	offset = gpiospec->args[0] - bank->gc.offset;
19a7b6940b7812 Gregory Fong  2015-07-31  415  	if (offset >= gc->ngpio || offset < 0)
3b0213d56eb7f7 Gregory Fong  2015-05-28  416  		return -EINVAL;
3b0213d56eb7f7 Gregory Fong  2015-05-28  417  
3b0213d56eb7f7 Gregory Fong  2015-05-28  418  	if (unlikely(offset >= bank->width)) {
3b0213d56eb7f7 Gregory Fong  2015-05-28  419  		dev_warn_ratelimited(&priv->pdev->dev,
3b0213d56eb7f7 Gregory Fong  2015-05-28  420  			"Received request for invalid GPIO offset %d\n",
3b0213d56eb7f7 Gregory Fong  2015-05-28  421  			gpiospec->args[0]);
3b0213d56eb7f7 Gregory Fong  2015-05-28  422  	}
3b0213d56eb7f7 Gregory Fong  2015-05-28  423  
3b0213d56eb7f7 Gregory Fong  2015-05-28  424  	if (flags)
3b0213d56eb7f7 Gregory Fong  2015-05-28  425  		*flags = gpiospec->args[1];
3b0213d56eb7f7 Gregory Fong  2015-05-28  426  
3b0213d56eb7f7 Gregory Fong  2015-05-28  427  	return offset;
3b0213d56eb7f7 Gregory Fong  2015-05-28  428  }
3b0213d56eb7f7 Gregory Fong  2015-05-28  429  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
Posted by kernel test robot 1 month ago
Hi Bartosz,

kernel test robot noticed the following build warnings:

[auto build test WARNING on brgl/gpio/for-next]
[also build test WARNING on linus/master v6.12-rc4 next-20241025]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpio-relax-the-Kconfig-dependency-on-OF_GPIO-in-drivers/20241025-032925
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20241024192758.91748-1-brgl%40bgdev.pl
patch subject: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
config: i386-kismet-CONFIG_GPIO_SYSCON-CONFIG_GPIO_SAMA5D2_PIOBU-0-0 (https://download.01.org/0day-ci/archive/20241025/202410252227.4k7pn2o5-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20241025/202410252227.4k7pn2o5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410252227.4k7pn2o5-lkp@intel.com/

kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for GPIO_SYSCON when selected by GPIO_SAMA5D2_PIOBU
   WARNING: unmet direct dependencies detected for GPIO_SYSCON
     Depends on [n]: GPIOLIB [=y] && HAS_IOMEM [=y] && MFD_SYSCON [=y] && OF [=n]
     Selected by [y]:
     - GPIO_SAMA5D2_PIOBU [=y] && GPIOLIB [=y] && HAS_IOMEM [=y] && MFD_SYSCON [=y] && (ARCH_AT91 || COMPILE_TEST [=y])

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
Posted by Bartosz Golaszewski 1 month ago
On Fri, Oct 25, 2024 at 5:08 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Bartosz,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on brgl/gpio/for-next]
> [also build test WARNING on linus/master v6.12-rc4 next-20241025]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpio-relax-the-Kconfig-dependency-on-OF_GPIO-in-drivers/20241025-032925
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
> patch link:    https://lore.kernel.org/r/20241024192758.91748-1-brgl%40bgdev.pl
> patch subject: [PATCH] gpio: relax the Kconfig dependency on OF_GPIO in drivers
> config: i386-kismet-CONFIG_GPIO_SYSCON-CONFIG_GPIO_SAMA5D2_PIOBU-0-0 (https://download.01.org/0day-ci/archive/20241025/202410252227.4k7pn2o5-lkp@intel.com/config)
> reproduce: (https://download.01.org/0day-ci/archive/20241025/202410252227.4k7pn2o5-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202410252227.4k7pn2o5-lkp@intel.com/
>
> kismet warnings: (new ones prefixed by >>)
> >> kismet: WARNING: unmet direct dependencies detected for GPIO_SYSCON when selected by GPIO_SAMA5D2_PIOBU
>    WARNING: unmet direct dependencies detected for GPIO_SYSCON
>      Depends on [n]: GPIOLIB [=y] && HAS_IOMEM [=y] && MFD_SYSCON [=y] && OF [=n]
>      Selected by [y]:
>      - GPIO_SAMA5D2_PIOBU [=y] && GPIOLIB [=y] && HAS_IOMEM [=y] && MFD_SYSCON [=y] && (ARCH_AT91 || COMPILE_TEST [=y])
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

Eh, OF_GPIO pulls in the OF and HAS_IOMEM dependency so his must be
done on a driver-by-driver basis.

Let's drop this for now.

Bartosz