public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] pinctrl: core: Drop unused include
@ 2026-03-20 22:05 Andy Shevchenko
  2026-03-21  7:27 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-20 22:05 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel

This driver includes the legacy header <linux/gpio.h> but does
not use any symbols from it. Drop the inclusion.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 254161d52da7..bec8ca8ec089 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -24,7 +24,6 @@
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 
-#include <linux/gpio.h>
 #include <linux/gpio/driver.h>
 
 #include <linux/pinctrl/consumer.h>
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: core: Drop unused include
  2026-03-20 22:05 [PATCH v1 1/1] pinctrl: core: Drop unused include Andy Shevchenko
@ 2026-03-21  7:27 ` kernel test robot
  2026-03-21  9:55 ` kernel test robot
  2026-03-21  9:55 ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-03-21  7:27 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, linux-gpio, linux-kernel; +Cc: oe-kbuild-all

Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next linus/master v7.0-rc4 next-20260320]
[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/Andy-Shevchenko/pinctrl-core-Drop-unused-include/20260321-095653
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20260320220550.3237142-1-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 1/1] pinctrl: core: Drop unused include
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260321/202603210823.dmrUGhlf-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260321/202603210823.dmrUGhlf-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/202603210823.dmrUGhlf-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/pinctrl/core.c: In function 'pinctrl_pins_show':
>> drivers/pinctrl/core.c:1742:53: error: implicit declaration of function 'gpio_to_desc'; did you mean 'gpio_to_pin'? [-Wimplicit-function-declaration]
    1742 |                         gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
         |                                                     ^~~~~~~~~~~~
         |                                                     gpio_to_pin
>> drivers/pinctrl/core.c:1742:53: error: passing argument 1 of 'gpiod_to_gpio_device' makes pointer from integer without a cast [-Wint-conversion]
    1742 |                         gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
         |                                                     ^~~~~~~~~~~~~~~~~~~~~~
         |                                                     |
         |                                                     int
   In file included from drivers/pinctrl/core.c:27:
   include/linux/gpio/driver.h:817:60: note: expected 'struct gpio_desc *' but argument is of type 'int'
     817 | struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc);
         |                                          ~~~~~~~~~~~~~~~~~~^~~~


vim +1742 drivers/pinctrl/core.c

2744e8afb3b763 Linus Walleij       2011-05-02  1700  
2744e8afb3b763 Linus Walleij       2011-05-02  1701  	seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
2744e8afb3b763 Linus Walleij       2011-05-02  1702  
42fed7ba44e4e8 Patrice Chotard     2013-04-11  1703  	mutex_lock(&pctldev->mutex);
57b676f9c1b7cd Stephen Warren      2012-03-02  1704  
706e8520e8450a Chanho Park         2012-01-03  1705  	/* The pin number can be retrived from the pin controller descriptor */
706e8520e8450a Chanho Park         2012-01-03  1706  	for (i = 0; i < pctldev->desc->npins; i++) {
2744e8afb3b763 Linus Walleij       2011-05-02  1707  		struct pin_desc *desc;
2744e8afb3b763 Linus Walleij       2011-05-02  1708  
706e8520e8450a Chanho Park         2012-01-03  1709  		pin = pctldev->desc->pins[i].number;
2744e8afb3b763 Linus Walleij       2011-05-02  1710  		desc = pin_desc_get(pctldev, pin);
2744e8afb3b763 Linus Walleij       2011-05-02  1711  		/* Pin space may be sparse */
cea234e996922d Markus Elfring      2017-05-02  1712  		if (!desc)
2744e8afb3b763 Linus Walleij       2011-05-02  1713  			continue;
2744e8afb3b763 Linus Walleij       2011-05-02  1714  
cf9d994dcf00c0 Masahiro Yamada     2016-05-24  1715  		seq_printf(s, "pin %d (%s) ", pin, desc->name);
2744e8afb3b763 Linus Walleij       2011-05-02  1716  
f1b206cf7c5756 Drew Fustini        2020-07-22  1717  #ifdef CONFIG_GPIOLIB
9dfbcf2fc566c0 Léo DUBOIN          2024-04-25  1718  		gdev = NULL;
482715ff0601c8 Andy Shevchenko     2021-04-15  1719  		gpio_num = -1;
f1b206cf7c5756 Drew Fustini        2020-07-22  1720  		list_for_each_entry(range, &pctldev->gpio_ranges, node) {
db5032981ab37e Léo DUBOIN          2024-04-25  1721  			if (range->pins != NULL) {
db5032981ab37e Léo DUBOIN          2024-04-25  1722  				for (int i = 0; i < range->npins; ++i) {
db5032981ab37e Léo DUBOIN          2024-04-25  1723  					if (range->pins[i] == pin) {
db5032981ab37e Léo DUBOIN          2024-04-25  1724  						gpio_num = range->base + i;
f1b206cf7c5756 Drew Fustini        2020-07-22  1725  						break;
f1b206cf7c5756 Drew Fustini        2020-07-22  1726  					}
f1b206cf7c5756 Drew Fustini        2020-07-22  1727  				}
db5032981ab37e Léo DUBOIN          2024-04-25  1728  			} else if ((pin >= range->pin_base) &&
db5032981ab37e Léo DUBOIN          2024-04-25  1729  				   (pin < (range->pin_base + range->npins))) {
db5032981ab37e Léo DUBOIN          2024-04-25  1730  				gpio_num =
db5032981ab37e Léo DUBOIN          2024-04-25  1731  					range->base + (pin - range->pin_base);
db5032981ab37e Léo DUBOIN          2024-04-25  1732  			}
db5032981ab37e Léo DUBOIN          2024-04-25  1733  			if (gpio_num != -1)
db5032981ab37e Léo DUBOIN          2024-04-25  1734  				break;
db5032981ab37e Léo DUBOIN          2024-04-25  1735  		}
482715ff0601c8 Andy Shevchenko     2021-04-15  1736  		if (gpio_num >= 0)
e3863fa123c8fd Linus Walleij       2023-01-20  1737  			/*
e3863fa123c8fd Linus Walleij       2023-01-20  1738  			 * FIXME: gpio_num comes from the global GPIO numberspace.
e3863fa123c8fd Linus Walleij       2023-01-20  1739  			 * we need to get rid of the range->base eventually and
e3863fa123c8fd Linus Walleij       2023-01-20  1740  			 * get the descriptor directly from the gpio_chip.
e3863fa123c8fd Linus Walleij       2023-01-20  1741  			 */
524fc108b89586 Bartosz Golaszewski 2023-11-15 @1742  			gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
524fc108b89586 Bartosz Golaszewski 2023-11-15  1743  		if (gdev)
524fc108b89586 Bartosz Golaszewski 2023-11-15  1744  			seq_printf(s, "%u:%s ",
524fc108b89586 Bartosz Golaszewski 2023-11-15  1745  				   gpio_num - gpio_device_get_base(gdev),
524fc108b89586 Bartosz Golaszewski 2023-11-15  1746  				   gpio_device_get_label(gdev));
f1b206cf7c5756 Drew Fustini        2020-07-22  1747  		else
f1b206cf7c5756 Drew Fustini        2020-07-22  1748  			seq_puts(s, "0:? ");
f1b206cf7c5756 Drew Fustini        2020-07-22  1749  #endif
f1b206cf7c5756 Drew Fustini        2020-07-22  1750  
2744e8afb3b763 Linus Walleij       2011-05-02  1751  		/* Driver-specific info per pin */
2744e8afb3b763 Linus Walleij       2011-05-02  1752  		if (ops->pin_dbg_show)
2744e8afb3b763 Linus Walleij       2011-05-02  1753  			ops->pin_dbg_show(pctldev, s, pin);
2744e8afb3b763 Linus Walleij       2011-05-02  1754  
2744e8afb3b763 Linus Walleij       2011-05-02  1755  		seq_puts(s, "\n");
2744e8afb3b763 Linus Walleij       2011-05-02  1756  	}
2744e8afb3b763 Linus Walleij       2011-05-02  1757  
42fed7ba44e4e8 Patrice Chotard     2013-04-11  1758  	mutex_unlock(&pctldev->mutex);
57b676f9c1b7cd Stephen Warren      2012-03-02  1759  
2744e8afb3b763 Linus Walleij       2011-05-02  1760  	return 0;
2744e8afb3b763 Linus Walleij       2011-05-02  1761  }
b5520891a3491c Andy Shevchenko     2018-02-17  1762  DEFINE_SHOW_ATTRIBUTE(pinctrl_pins);
2744e8afb3b763 Linus Walleij       2011-05-02  1763  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: core: Drop unused include
  2026-03-20 22:05 [PATCH v1 1/1] pinctrl: core: Drop unused include Andy Shevchenko
  2026-03-21  7:27 ` kernel test robot
@ 2026-03-21  9:55 ` kernel test robot
  2026-03-21  9:55 ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-03-21  9:55 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, linux-gpio, linux-kernel; +Cc: oe-kbuild-all

Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next linus/master v7.0-rc4 next-20260320]
[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/Andy-Shevchenko/pinctrl-core-Drop-unused-include/20260321-095653
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20260320220550.3237142-1-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 1/1] pinctrl: core: Drop unused include
config: i386-randconfig-011-20260321 (https://download.01.org/0day-ci/archive/20260321/202603211735.MWgZlCwg-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260321/202603211735.MWgZlCwg-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/202603211735.MWgZlCwg-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/pinctrl/core.c: In function 'pinctrl_pins_show':
   drivers/pinctrl/core.c:1742:53: error: implicit declaration of function 'gpio_to_desc'; did you mean 'gpio_to_pin'? [-Wimplicit-function-declaration]
    1742 |                         gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
         |                                                     ^~~~~~~~~~~~
         |                                                     gpio_to_pin
>> drivers/pinctrl/core.c:1742:53: error: passing argument 1 of 'gpiod_to_gpio_device' makes pointer from integer without a cast [-Wint-conversion]
    1742 |                         gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
         |                                                     ^~~~~~~~~~~~~~~~~~~~~~
         |                                                     |
         |                                                     int
   In file included from drivers/pinctrl/core.c:27:
   include/linux/gpio/driver.h:817:60: note: expected 'struct gpio_desc *' but argument is of type 'int'
     817 | struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc);
         |                                          ~~~~~~~~~~~~~~~~~~^~~~


vim +/gpiod_to_gpio_device +1742 drivers/pinctrl/core.c

2744e8afb3b7634 Linus Walleij       2011-05-02  1700  
2744e8afb3b7634 Linus Walleij       2011-05-02  1701  	seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
2744e8afb3b7634 Linus Walleij       2011-05-02  1702  
42fed7ba44e4e8c Patrice Chotard     2013-04-11  1703  	mutex_lock(&pctldev->mutex);
57b676f9c1b7cd8 Stephen Warren      2012-03-02  1704  
706e8520e8450a6 Chanho Park         2012-01-03  1705  	/* The pin number can be retrived from the pin controller descriptor */
706e8520e8450a6 Chanho Park         2012-01-03  1706  	for (i = 0; i < pctldev->desc->npins; i++) {
2744e8afb3b7634 Linus Walleij       2011-05-02  1707  		struct pin_desc *desc;
2744e8afb3b7634 Linus Walleij       2011-05-02  1708  
706e8520e8450a6 Chanho Park         2012-01-03  1709  		pin = pctldev->desc->pins[i].number;
2744e8afb3b7634 Linus Walleij       2011-05-02  1710  		desc = pin_desc_get(pctldev, pin);
2744e8afb3b7634 Linus Walleij       2011-05-02  1711  		/* Pin space may be sparse */
cea234e996922d4 Markus Elfring      2017-05-02  1712  		if (!desc)
2744e8afb3b7634 Linus Walleij       2011-05-02  1713  			continue;
2744e8afb3b7634 Linus Walleij       2011-05-02  1714  
cf9d994dcf00c09 Masahiro Yamada     2016-05-24  1715  		seq_printf(s, "pin %d (%s) ", pin, desc->name);
2744e8afb3b7634 Linus Walleij       2011-05-02  1716  
f1b206cf7c57561 Drew Fustini        2020-07-22  1717  #ifdef CONFIG_GPIOLIB
9dfbcf2fc566c0b Léo DUBOIN          2024-04-25  1718  		gdev = NULL;
482715ff0601c83 Andy Shevchenko     2021-04-15  1719  		gpio_num = -1;
f1b206cf7c57561 Drew Fustini        2020-07-22  1720  		list_for_each_entry(range, &pctldev->gpio_ranges, node) {
db5032981ab37eb Léo DUBOIN          2024-04-25  1721  			if (range->pins != NULL) {
db5032981ab37eb Léo DUBOIN          2024-04-25  1722  				for (int i = 0; i < range->npins; ++i) {
db5032981ab37eb Léo DUBOIN          2024-04-25  1723  					if (range->pins[i] == pin) {
db5032981ab37eb Léo DUBOIN          2024-04-25  1724  						gpio_num = range->base + i;
f1b206cf7c57561 Drew Fustini        2020-07-22  1725  						break;
f1b206cf7c57561 Drew Fustini        2020-07-22  1726  					}
f1b206cf7c57561 Drew Fustini        2020-07-22  1727  				}
db5032981ab37eb Léo DUBOIN          2024-04-25  1728  			} else if ((pin >= range->pin_base) &&
db5032981ab37eb Léo DUBOIN          2024-04-25  1729  				   (pin < (range->pin_base + range->npins))) {
db5032981ab37eb Léo DUBOIN          2024-04-25  1730  				gpio_num =
db5032981ab37eb Léo DUBOIN          2024-04-25  1731  					range->base + (pin - range->pin_base);
db5032981ab37eb Léo DUBOIN          2024-04-25  1732  			}
db5032981ab37eb Léo DUBOIN          2024-04-25  1733  			if (gpio_num != -1)
db5032981ab37eb Léo DUBOIN          2024-04-25  1734  				break;
db5032981ab37eb Léo DUBOIN          2024-04-25  1735  		}
482715ff0601c83 Andy Shevchenko     2021-04-15  1736  		if (gpio_num >= 0)
e3863fa123c8fd9 Linus Walleij       2023-01-20  1737  			/*
e3863fa123c8fd9 Linus Walleij       2023-01-20  1738  			 * FIXME: gpio_num comes from the global GPIO numberspace.
e3863fa123c8fd9 Linus Walleij       2023-01-20  1739  			 * we need to get rid of the range->base eventually and
e3863fa123c8fd9 Linus Walleij       2023-01-20  1740  			 * get the descriptor directly from the gpio_chip.
e3863fa123c8fd9 Linus Walleij       2023-01-20  1741  			 */
524fc108b895868 Bartosz Golaszewski 2023-11-15 @1742  			gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
524fc108b895868 Bartosz Golaszewski 2023-11-15  1743  		if (gdev)
524fc108b895868 Bartosz Golaszewski 2023-11-15  1744  			seq_printf(s, "%u:%s ",
524fc108b895868 Bartosz Golaszewski 2023-11-15  1745  				   gpio_num - gpio_device_get_base(gdev),
524fc108b895868 Bartosz Golaszewski 2023-11-15  1746  				   gpio_device_get_label(gdev));
f1b206cf7c57561 Drew Fustini        2020-07-22  1747  		else
f1b206cf7c57561 Drew Fustini        2020-07-22  1748  			seq_puts(s, "0:? ");
f1b206cf7c57561 Drew Fustini        2020-07-22  1749  #endif
f1b206cf7c57561 Drew Fustini        2020-07-22  1750  
2744e8afb3b7634 Linus Walleij       2011-05-02  1751  		/* Driver-specific info per pin */
2744e8afb3b7634 Linus Walleij       2011-05-02  1752  		if (ops->pin_dbg_show)
2744e8afb3b7634 Linus Walleij       2011-05-02  1753  			ops->pin_dbg_show(pctldev, s, pin);
2744e8afb3b7634 Linus Walleij       2011-05-02  1754  
2744e8afb3b7634 Linus Walleij       2011-05-02  1755  		seq_puts(s, "\n");
2744e8afb3b7634 Linus Walleij       2011-05-02  1756  	}
2744e8afb3b7634 Linus Walleij       2011-05-02  1757  
42fed7ba44e4e8c Patrice Chotard     2013-04-11  1758  	mutex_unlock(&pctldev->mutex);
57b676f9c1b7cd8 Stephen Warren      2012-03-02  1759  
2744e8afb3b7634 Linus Walleij       2011-05-02  1760  	return 0;
2744e8afb3b7634 Linus Walleij       2011-05-02  1761  }
b5520891a3491cd Andy Shevchenko     2018-02-17  1762  DEFINE_SHOW_ATTRIBUTE(pinctrl_pins);
2744e8afb3b7634 Linus Walleij       2011-05-02  1763  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: core: Drop unused include
  2026-03-20 22:05 [PATCH v1 1/1] pinctrl: core: Drop unused include Andy Shevchenko
  2026-03-21  7:27 ` kernel test robot
  2026-03-21  9:55 ` kernel test robot
@ 2026-03-21  9:55 ` kernel test robot
  2026-03-21 13:19   ` Andy Shevchenko
  2 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2026-03-21  9:55 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, linux-gpio, linux-kernel
  Cc: llvm, oe-kbuild-all

Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next linus/master v7.0-rc4 next-20260320]
[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/Andy-Shevchenko/pinctrl-core-Drop-unused-include/20260321-095653
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20260320220550.3237142-1-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 1/1] pinctrl: core: Drop unused include
config: hexagon-randconfig-001-20260321 (https://download.01.org/0day-ci/archive/20260321/202603211748.5YfMNVO3-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 4abb927bacf37f18f6359a41639a6d1b3bffffb5)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260321/202603211748.5YfMNVO3-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/202603211748.5YfMNVO3-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pinctrl/core.c:1742:32: error: call to undeclared function 'gpio_to_desc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1742 |                         gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
         |                                                     ^
>> drivers/pinctrl/core.c:1742:32: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct gpio_desc *' [-Wint-conversion]
    1742 |                         gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
         |                                                     ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/gpio/driver.h:817:60: note: passing argument to parameter 'desc' here
     817 | struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc);
         |                                                            ^
   2 errors generated.


vim +/gpio_to_desc +1742 drivers/pinctrl/core.c

2744e8afb3b763 Linus Walleij       2011-05-02  1700  
2744e8afb3b763 Linus Walleij       2011-05-02  1701  	seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
2744e8afb3b763 Linus Walleij       2011-05-02  1702  
42fed7ba44e4e8 Patrice Chotard     2013-04-11  1703  	mutex_lock(&pctldev->mutex);
57b676f9c1b7cd Stephen Warren      2012-03-02  1704  
706e8520e8450a Chanho Park         2012-01-03  1705  	/* The pin number can be retrived from the pin controller descriptor */
706e8520e8450a Chanho Park         2012-01-03  1706  	for (i = 0; i < pctldev->desc->npins; i++) {
2744e8afb3b763 Linus Walleij       2011-05-02  1707  		struct pin_desc *desc;
2744e8afb3b763 Linus Walleij       2011-05-02  1708  
706e8520e8450a Chanho Park         2012-01-03  1709  		pin = pctldev->desc->pins[i].number;
2744e8afb3b763 Linus Walleij       2011-05-02  1710  		desc = pin_desc_get(pctldev, pin);
2744e8afb3b763 Linus Walleij       2011-05-02  1711  		/* Pin space may be sparse */
cea234e996922d Markus Elfring      2017-05-02  1712  		if (!desc)
2744e8afb3b763 Linus Walleij       2011-05-02  1713  			continue;
2744e8afb3b763 Linus Walleij       2011-05-02  1714  
cf9d994dcf00c0 Masahiro Yamada     2016-05-24  1715  		seq_printf(s, "pin %d (%s) ", pin, desc->name);
2744e8afb3b763 Linus Walleij       2011-05-02  1716  
f1b206cf7c5756 Drew Fustini        2020-07-22  1717  #ifdef CONFIG_GPIOLIB
9dfbcf2fc566c0 Léo DUBOIN          2024-04-25  1718  		gdev = NULL;
482715ff0601c8 Andy Shevchenko     2021-04-15  1719  		gpio_num = -1;
f1b206cf7c5756 Drew Fustini        2020-07-22  1720  		list_for_each_entry(range, &pctldev->gpio_ranges, node) {
db5032981ab37e Léo DUBOIN          2024-04-25  1721  			if (range->pins != NULL) {
db5032981ab37e Léo DUBOIN          2024-04-25  1722  				for (int i = 0; i < range->npins; ++i) {
db5032981ab37e Léo DUBOIN          2024-04-25  1723  					if (range->pins[i] == pin) {
db5032981ab37e Léo DUBOIN          2024-04-25  1724  						gpio_num = range->base + i;
f1b206cf7c5756 Drew Fustini        2020-07-22  1725  						break;
f1b206cf7c5756 Drew Fustini        2020-07-22  1726  					}
f1b206cf7c5756 Drew Fustini        2020-07-22  1727  				}
db5032981ab37e Léo DUBOIN          2024-04-25  1728  			} else if ((pin >= range->pin_base) &&
db5032981ab37e Léo DUBOIN          2024-04-25  1729  				   (pin < (range->pin_base + range->npins))) {
db5032981ab37e Léo DUBOIN          2024-04-25  1730  				gpio_num =
db5032981ab37e Léo DUBOIN          2024-04-25  1731  					range->base + (pin - range->pin_base);
db5032981ab37e Léo DUBOIN          2024-04-25  1732  			}
db5032981ab37e Léo DUBOIN          2024-04-25  1733  			if (gpio_num != -1)
db5032981ab37e Léo DUBOIN          2024-04-25  1734  				break;
db5032981ab37e Léo DUBOIN          2024-04-25  1735  		}
482715ff0601c8 Andy Shevchenko     2021-04-15  1736  		if (gpio_num >= 0)
e3863fa123c8fd Linus Walleij       2023-01-20  1737  			/*
e3863fa123c8fd Linus Walleij       2023-01-20  1738  			 * FIXME: gpio_num comes from the global GPIO numberspace.
e3863fa123c8fd Linus Walleij       2023-01-20  1739  			 * we need to get rid of the range->base eventually and
e3863fa123c8fd Linus Walleij       2023-01-20  1740  			 * get the descriptor directly from the gpio_chip.
e3863fa123c8fd Linus Walleij       2023-01-20  1741  			 */
524fc108b89586 Bartosz Golaszewski 2023-11-15 @1742  			gdev = gpiod_to_gpio_device(gpio_to_desc(gpio_num));
524fc108b89586 Bartosz Golaszewski 2023-11-15  1743  		if (gdev)
524fc108b89586 Bartosz Golaszewski 2023-11-15  1744  			seq_printf(s, "%u:%s ",
524fc108b89586 Bartosz Golaszewski 2023-11-15  1745  				   gpio_num - gpio_device_get_base(gdev),
524fc108b89586 Bartosz Golaszewski 2023-11-15  1746  				   gpio_device_get_label(gdev));
f1b206cf7c5756 Drew Fustini        2020-07-22  1747  		else
f1b206cf7c5756 Drew Fustini        2020-07-22  1748  			seq_puts(s, "0:? ");
f1b206cf7c5756 Drew Fustini        2020-07-22  1749  #endif
f1b206cf7c5756 Drew Fustini        2020-07-22  1750  
2744e8afb3b763 Linus Walleij       2011-05-02  1751  		/* Driver-specific info per pin */
2744e8afb3b763 Linus Walleij       2011-05-02  1752  		if (ops->pin_dbg_show)
2744e8afb3b763 Linus Walleij       2011-05-02  1753  			ops->pin_dbg_show(pctldev, s, pin);
2744e8afb3b763 Linus Walleij       2011-05-02  1754  
2744e8afb3b763 Linus Walleij       2011-05-02  1755  		seq_puts(s, "\n");
2744e8afb3b763 Linus Walleij       2011-05-02  1756  	}
2744e8afb3b763 Linus Walleij       2011-05-02  1757  
42fed7ba44e4e8 Patrice Chotard     2013-04-11  1758  	mutex_unlock(&pctldev->mutex);
57b676f9c1b7cd Stephen Warren      2012-03-02  1759  
2744e8afb3b763 Linus Walleij       2011-05-02  1760  	return 0;
2744e8afb3b763 Linus Walleij       2011-05-02  1761  }
b5520891a3491c Andy Shevchenko     2018-02-17  1762  DEFINE_SHOW_ATTRIBUTE(pinctrl_pins);
2744e8afb3b763 Linus Walleij       2011-05-02  1763  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: core: Drop unused include
  2026-03-21  9:55 ` kernel test robot
@ 2026-03-21 13:19   ` Andy Shevchenko
  2026-03-23 13:30     ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-21 13:19 UTC (permalink / raw)
  To: kernel test robot
  Cc: Linus Walleij, linux-gpio, linux-kernel, llvm, oe-kbuild-all

On Sat, Mar 21, 2026 at 05:55:35PM +0800, kernel test robot wrote:
> Hi Andy,
> 
> kernel test robot noticed the following build errors:

Ouch!

So, seems the gpio.h is used as a 'proxy' for some other headers.
I will test it carefully before sending v2.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: core: Drop unused include
  2026-03-21 13:19   ` Andy Shevchenko
@ 2026-03-23 13:30     ` Linus Walleij
  2026-03-23 13:36       ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2026-03-23 13:30 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: kernel test robot, linux-gpio, linux-kernel, llvm, oe-kbuild-all

On Sat, Mar 21, 2026 at 2:19 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Sat, Mar 21, 2026 at 05:55:35PM +0800, kernel test robot wrote:
> > Hi Andy,
> >
> > kernel test robot noticed the following build errors:
>
> Ouch!
>
> So, seems the gpio.h is used as a 'proxy' for some other headers.
> I will test it carefully before sending v2.

It's chill, I don't mind using the autobuilders for testing :)

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: core: Drop unused include
  2026-03-23 13:30     ` Linus Walleij
@ 2026-03-23 13:36       ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-23 13:36 UTC (permalink / raw)
  To: Linus Walleij
  Cc: kernel test robot, linux-gpio, linux-kernel, llvm, oe-kbuild-all

On Mon, Mar 23, 2026 at 02:30:46PM +0100, Linus Walleij wrote:
> On Sat, Mar 21, 2026 at 2:19 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Sat, Mar 21, 2026 at 05:55:35PM +0800, kernel test robot wrote:
> > >
> > > kernel test robot noticed the following build errors:
> >
> > Ouch!
> >
> > So, seems the gpio.h is used as a 'proxy' for some other headers.
> > I will test it carefully before sending v2.
> 
> It's chill, I don't mind using the autobuilders for testing :)

Sashiko already suggested to just replace gpio.h with gpio/consumer.h where
gpio_to_desc() is defined.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-23 13:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 22:05 [PATCH v1 1/1] pinctrl: core: Drop unused include Andy Shevchenko
2026-03-21  7:27 ` kernel test robot
2026-03-21  9:55 ` kernel test robot
2026-03-21  9:55 ` kernel test robot
2026-03-21 13:19   ` Andy Shevchenko
2026-03-23 13:30     ` Linus Walleij
2026-03-23 13:36       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox