[gpio:gpio-descriptors-regulator-fixup 7/10] drivers/gpio/gpiolib.c:4177:19: error: conflicting types for 'gpiod_get_from_of_node'

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-regulator-fixup
head:   0aaccc590e7a2f0d6f846c9e3698168e6d0c01f8
commit: 6bdabb304f4dcc6f82dfb2eed272f219ce97c65c [7/10] gpio: Export gpiod_get_from_of_node()
config: sh-allyesconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 6bdabb304f4dcc6f82dfb2eed272f219ce97c65c
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sh 

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

>> drivers/gpio/gpiolib.c:4177:19: error: conflicting types for 'gpiod_get_from_of_node'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/gpio.h:14:0,
                    from arch/sh/include/asm/gpio.h:23,
                    from include/linux/gpio.h:59,
                    from drivers/gpio/gpiolib.c:13:
   include/linux/gpio/consumer.h:175:19: note: previous declaration of 'gpiod_get_from_of_node' was here
    struct gpio_desc *gpiod_get_from_of_node(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7:0,
                    from include/linux/kernel.h:7,
                    from include/linux/bitmap.h:10,
                    from drivers/gpio/gpiolib.c:2:
   drivers/gpio/gpiolib.c:4231:15: error: conflicting types for 'gpiod_get_from_of_node'
    EXPORT_SYMBOL(gpiod_get_from_of_node);
                  ^
   include/linux/export.h:79:21: note: in definition of macro '___EXPORT_SYMBOL'
     extern typeof(sym) sym;      \
                        ^~~
>> drivers/gpio/gpiolib.c:4231:1: note: in expansion of macro 'EXPORT_SYMBOL'
    EXPORT_SYMBOL(gpiod_get_from_of_node);
    ^~~~~~~~~~~~~
   In file included from include/asm-generic/gpio.h:14:0,
                    from arch/sh/include/asm/gpio.h:23,
                    from include/linux/gpio.h:59,
                    from drivers/gpio/gpiolib.c:13:
   include/linux/gpio/consumer.h:175:19: note: previous declaration of 'gpiod_get_from_of_node' was here
    struct gpio_desc *gpiod_get_from_of_node(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~
--
   drivers/gpio/gpiolib-devres.c: In function 'devm_gpiod_get_from_of_node':
>> drivers/gpio/gpiolib-devres.c:148:32: error: passing argument 1 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
     desc = gpiod_get_from_of_node(node, propname, index, dflags, label);
                                   ^~~~
   In file included from include/asm-generic/gpio.h:14:0,
                    from arch/sh/include/asm/gpio.h:23,
                    from include/linux/gpio.h:59,
                    from drivers/gpio/gpiolib-devres.c:11:
   include/linux/gpio/consumer.h:175:19: note: expected 'struct device *' but argument is of type 'struct device_node *'
    struct gpio_desc *gpiod_get_from_of_node(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~
   drivers/gpio/gpiolib-devres.c:148:38: error: passing argument 2 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
     desc = gpiod_get_from_of_node(node, propname, index, dflags, label);
                                         ^~~~~~~~
   In file included from include/asm-generic/gpio.h:14:0,
                    from arch/sh/include/asm/gpio.h:23,
                    from include/linux/gpio.h:59,
                    from drivers/gpio/gpiolib-devres.c:11:
   include/linux/gpio/consumer.h:175:19: note: expected 'struct device_node *' but argument is of type 'const char *'
    struct gpio_desc *gpiod_get_from_of_node(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpio/gpiolib-devres.c:148:48: warning: passing argument 3 of 'gpiod_get_from_of_node' makes pointer from integer without a cast [-Wint-conversion]
     desc = gpiod_get_from_of_node(node, propname, index, dflags, label);
                                                   ^~~~~
   In file included from include/asm-generic/gpio.h:14:0,
                    from arch/sh/include/asm/gpio.h:23,
                    from include/linux/gpio.h:59,
                    from drivers/gpio/gpiolib-devres.c:11:
   include/linux/gpio/consumer.h:175:19: note: expected 'const char *' but argument is of type 'int'
    struct gpio_desc *gpiod_get_from_of_node(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpio/gpiolib-devres.c:148:63: error: incompatible type for argument 5 of 'gpiod_get_from_of_node'
     desc = gpiod_get_from_of_node(node, propname, index, dflags, label);
                                                                  ^~~~~
   In file included from include/asm-generic/gpio.h:14:0,
                    from arch/sh/include/asm/gpio.h:23,
                    from include/linux/gpio.h:59,
                    from drivers/gpio/gpiolib-devres.c:11:
   include/linux/gpio/consumer.h:175:19: note: expected 'enum gpiod_flags' but argument is of type 'const char *'
    struct gpio_desc *gpiod_get_from_of_node(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpio/gpiolib-devres.c:148:9: error: too few arguments to function 'gpiod_get_from_of_node'
     desc = gpiod_get_from_of_node(node, propname, index, dflags, label);
            ^~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/gpio.h:14:0,
                    from arch/sh/include/asm/gpio.h:23,
                    from include/linux/gpio.h:59,
                    from drivers/gpio/gpiolib-devres.c:11:
   include/linux/gpio/consumer.h:175:19: note: declared here
    struct gpio_desc *gpiod_get_from_of_node(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/gpiod_get_from_of_node +4177 drivers/gpio/gpiolib.c

bae48da23 Alexandre Courbot 2013-10-17  4161  
bae48da23 Alexandre Courbot 2013-10-17  4162  /**
6392cca42 Linus Walleij     2017-12-29  4163   * gpiod_get_from_of_node() - obtain a GPIO from an OF node
6392cca42 Linus Walleij     2017-12-29  4164   * @node:	handle of the OF node
6392cca42 Linus Walleij     2017-12-29  4165   * @propname:	name of the DT property representing the GPIO
6392cca42 Linus Walleij     2017-12-29  4166   * @index:	index of the GPIO to obtain for the consumer
a264d10ff Andy Shevchenko   2017-01-09  4167   * @dflags:	GPIO initialization flags
950d55f5b Thierry Reding    2017-07-24  4168   * @label:	label to attach to the requested GPIO
40b731831 Mika Westerberg   2014-10-21  4169   *
950d55f5b Thierry Reding    2017-07-24  4170   * Returns:
ff21378a3 Andy Shevchenko   2017-02-28  4171   * On successful request the GPIO pin is configured in accordance with
6392cca42 Linus Walleij     2017-12-29  4172   * provided @dflags. If the node does not have the requested GPIO
6392cca42 Linus Walleij     2017-12-29  4173   * property, NULL is returned.
a264d10ff Andy Shevchenko   2017-01-09  4174   *
40b731831 Mika Westerberg   2014-10-21  4175   * In case of error an ERR_PTR() is returned.
40b731831 Mika Westerberg   2014-10-21  4176   */
92542edc4 Linus Walleij     2017-12-29 @4177  struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
537b94daf Boris Brezillon   2017-02-02  4178  					 const char *propname, int index,
b2987d743 Alexander Stein   2017-01-12  4179  					 enum gpiod_flags dflags,
b2987d743 Alexander Stein   2017-01-12  4180  					 const char *label)
40b731831 Mika Westerberg   2014-10-21  4181  {
40a3c9db0 Colin Ian King    2018-01-16  4182  	struct gpio_desc *desc;
a264d10ff Andy Shevchenko   2017-01-09  4183  	unsigned long lflags = 0;
6392cca42 Linus Walleij     2017-12-29  4184  	enum of_gpio_flags flags;
40b731831 Mika Westerberg   2014-10-21  4185  	bool active_low = false;
90b665f62 Laurent Pinchart  2015-10-13  4186  	bool single_ended = false;
4c0facddb Laxman Dewangan   2017-04-06  4187  	bool open_drain = false;
e10f72bf4 Andrew Jeffery    2017-11-30  4188  	bool transitory = false;
40b731831 Mika Westerberg   2014-10-21  4189  	int ret;
40b731831 Mika Westerberg   2014-10-21  4190  
6392cca42 Linus Walleij     2017-12-29  4191  	desc = of_get_named_gpiod_flags(node, propname,
6392cca42 Linus Walleij     2017-12-29  4192  					index, &flags);
40b731831 Mika Westerberg   2014-10-21  4193  
6392cca42 Linus Walleij     2017-12-29  4194  	if (!desc || IS_ERR(desc)) {
6392cca42 Linus Walleij     2017-12-29  4195  		/* If it is not there, just return NULL */
6392cca42 Linus Walleij     2017-12-29  4196  		if (PTR_ERR(desc) == -ENOENT)
6392cca42 Linus Walleij     2017-12-29  4197  			return NULL;
6392cca42 Linus Walleij     2017-12-29  4198  		return desc;
6392cca42 Linus Walleij     2017-12-29  4199  	}
40b731831 Mika Westerberg   2014-10-21  4200  
40b731831 Mika Westerberg   2014-10-21  4201  	active_low = flags & OF_GPIO_ACTIVE_LOW;
90b665f62 Laurent Pinchart  2015-10-13  4202  	single_ended = flags & OF_GPIO_SINGLE_ENDED;
4c0facddb Laxman Dewangan   2017-04-06  4203  	open_drain = flags & OF_GPIO_OPEN_DRAIN;
e10f72bf4 Andrew Jeffery    2017-11-30  4204  	transitory = flags & OF_GPIO_TRANSITORY;
40b731831 Mika Westerberg   2014-10-21  4205  
b2987d743 Alexander Stein   2017-01-12  4206  	ret = gpiod_request(desc, label);
85b03b303 Johan Hovold      2016-07-03  4207  	if (ret)
85b03b303 Johan Hovold      2016-07-03  4208  		return ERR_PTR(ret);
85b03b303 Johan Hovold      2016-07-03  4209  
40b731831 Mika Westerberg   2014-10-21  4210  	if (active_low)
a264d10ff Andy Shevchenko   2017-01-09  4211  		lflags |= GPIO_ACTIVE_LOW;
40b731831 Mika Westerberg   2014-10-21  4212  
90b665f62 Laurent Pinchart  2015-10-13  4213  	if (single_ended) {
4c0facddb Laxman Dewangan   2017-04-06  4214  		if (open_drain)
a264d10ff Andy Shevchenko   2017-01-09  4215  			lflags |= GPIO_OPEN_DRAIN;
90b665f62 Laurent Pinchart  2015-10-13  4216  		else
a264d10ff Andy Shevchenko   2017-01-09  4217  			lflags |= GPIO_OPEN_SOURCE;
a264d10ff Andy Shevchenko   2017-01-09  4218  	}
a264d10ff Andy Shevchenko   2017-01-09  4219  
e10f72bf4 Andrew Jeffery    2017-11-30  4220  	if (transitory)
e10f72bf4 Andrew Jeffery    2017-11-30  4221  		lflags |= GPIO_TRANSITORY;
e10f72bf4 Andrew Jeffery    2017-11-30  4222  
a264d10ff Andy Shevchenko   2017-01-09  4223  	ret = gpiod_configure_flags(desc, propname, lflags, dflags);
6392cca42 Linus Walleij     2017-12-29  4224  	if (ret < 0) {
6392cca42 Linus Walleij     2017-12-29  4225  		gpiod_put(desc);
6392cca42 Linus Walleij     2017-12-29  4226  		return ERR_PTR(ret);
6392cca42 Linus Walleij     2017-12-29  4227  	}
6392cca42 Linus Walleij     2017-12-29  4228  
6392cca42 Linus Walleij     2017-12-29  4229  	return desc;
6392cca42 Linus Walleij     2017-12-29  4230  }
92542edc4 Linus Walleij     2017-12-29 @4231  EXPORT_SYMBOL(gpiod_get_from_of_node);
6392cca42 Linus Walleij     2017-12-29  4232  

:::::: The code at line 4177 was first introduced by commit
:::::: 92542edc42496ac4b8f5ba0ae81ab5776db9473b gpio: Export devm_gpiod_get_from_of_node() for consumers

:::::: TO: Linus Walleij <linus.walleij@xxxxxxxxxx>
:::::: CC: Linus Walleij <linus.walleij@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[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