[gpio:gpio-descriptors-regulator-fixup 8/10] drivers/regulator/da9211-regulator.c:296:48: error: passing argument 1 of 'gpiod_get_from_of_node' from incompatible pointer type

[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:   9147361eb80075e5eb6cae3ddec80c7dd3c9e0d9
commit: fbe06830640208958d58fb3af66b1d5f2add6b84 [8/10] regulator: max77686: Let core handle GPIO descriptor
config: i386-randconfig-x077-201847 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout fbe06830640208958d58fb3af66b1d5f2add6b84
        # save the attached .config to linux build tree
        make ARCH=i386 

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

   drivers/regulator/da9211-regulator.c: In function 'da9211_parse_regulators_dt':
>> drivers/regulator/da9211-regulator.c:296:48: error: passing argument 1 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
      pdata->gpiod_ren[n] = gpiod_get_from_of_node(dev,
                                                   ^~~
   In file included from drivers/regulator/da9211-regulator.c:27:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'struct device_node *' but argument is of type 'struct device *'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/da9211-regulator.c:297:7: error: passing argument 2 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
          da9211_matches[i].of_node,
          ^~~~~~~~~~~~~~
   In file included from drivers/regulator/da9211-regulator.c:27:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'const char *' but argument is of type 'struct device_node *'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/da9211-regulator.c:298:7: warning: passing argument 3 of 'gpiod_get_from_of_node' makes integer from pointer without a cast [-Wint-conversion]
          "enable",
          ^~~~~~~~
   In file included from drivers/regulator/da9211-regulator.c:27:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'int' but argument is of type 'char *'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/da9211-regulator.c:300:7: warning: passing argument 5 of 'gpiod_get_from_of_node' makes pointer from integer without a cast [-Wint-conversion]
          GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
          ^~~~~~~~~~~~~~
   In file included from drivers/regulator/da9211-regulator.c:27:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'const char *' but argument is of type 'long unsigned int'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/da9211-regulator.c:296:25: error: too many arguments to function 'gpiod_get_from_of_node'
      pdata->gpiod_ren[n] = gpiod_get_from_of_node(dev,
                            ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/regulator/da9211-regulator.c:27:0:
   include/linux/gpio/consumer.h:175:19: note: declared here
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/regulator/max77686-regulator.c: In function 'max77686_of_parse_cb':
>> drivers/regulator/max77686-regulator.c:258:46: error: passing argument 1 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
      config->ena_gpiod = gpiod_get_from_of_node(max77686->dev,
                                                 ^~~~~~~~
   In file included from drivers/regulator/max77686-regulator.c:14:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'struct device_node *' but argument is of type 'struct device *'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/max77686-regulator.c:259:5: error: passing argument 2 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
        np,
        ^~
   In file included from drivers/regulator/max77686-regulator.c:14:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'const char *' but argument is of type 'struct device_node *'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/max77686-regulator.c:260:5: warning: passing argument 3 of 'gpiod_get_from_of_node' makes integer from pointer without a cast [-Wint-conversion]
        "maxim,ena",
        ^~~~~~~~~~~
   In file included from drivers/regulator/max77686-regulator.c:14:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'int' but argument is of type 'char *'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/max77686-regulator.c:262:5: warning: passing argument 5 of 'gpiod_get_from_of_node' makes pointer from integer without a cast [-Wint-conversion]
        GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
        ^~~~~~~~~~~~~~
   In file included from drivers/regulator/max77686-regulator.c:14:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'const char *' but argument is of type 'long unsigned int'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/max77686-regulator.c:258:23: error: too many arguments to function 'gpiod_get_from_of_node'
      config->ena_gpiod = gpiod_get_from_of_node(max77686->dev,
                          ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/regulator/max77686-regulator.c:14:0:
   include/linux/gpio/consumer.h:175:19: note: declared here
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/gpiod_get_from_of_node +296 drivers/regulator/da9211-regulator.c

1028a37da James Ban     2014-07-14  255  
bf3baca6c James Ban     2014-08-27  256  #ifdef CONFIG_OF
bf3baca6c James Ban     2014-08-27  257  static struct of_regulator_match da9211_matches[] = {
bf3baca6c James Ban     2014-08-27  258  	[DA9211_ID_BUCKA] = { .name = "BUCKA" },
bf3baca6c James Ban     2014-08-27  259  	[DA9211_ID_BUCKB] = { .name = "BUCKB" },
bf3baca6c James Ban     2014-08-27  260  	};
bf3baca6c James Ban     2014-08-27  261  
bf3baca6c James Ban     2014-08-27  262  static struct da9211_pdata *da9211_parse_regulators_dt(
bf3baca6c James Ban     2014-08-27  263  		struct device *dev)
bf3baca6c James Ban     2014-08-27  264  {
bf3baca6c James Ban     2014-08-27  265  	struct da9211_pdata *pdata;
bf3baca6c James Ban     2014-08-27  266  	struct device_node *node;
bf3baca6c James Ban     2014-08-27  267  	int i, num, n;
bf3baca6c James Ban     2014-08-27  268  
bf3baca6c James Ban     2014-08-27  269  	node = of_get_child_by_name(dev->of_node, "regulators");
bf3baca6c James Ban     2014-08-27  270  	if (!node) {
bf3baca6c James Ban     2014-08-27  271  		dev_err(dev, "regulators node not found\n");
bf3baca6c James Ban     2014-08-27  272  		return ERR_PTR(-ENODEV);
bf3baca6c James Ban     2014-08-27  273  	}
bf3baca6c James Ban     2014-08-27  274  
bf3baca6c James Ban     2014-08-27  275  	num = of_regulator_match(dev, node, da9211_matches,
bf3baca6c James Ban     2014-08-27  276  				 ARRAY_SIZE(da9211_matches));
bf3baca6c James Ban     2014-08-27  277  	of_node_put(node);
bf3baca6c James Ban     2014-08-27  278  	if (num < 0) {
bf3baca6c James Ban     2014-08-27  279  		dev_err(dev, "Failed to match regulators\n");
bf3baca6c James Ban     2014-08-27  280  		return ERR_PTR(-EINVAL);
bf3baca6c James Ban     2014-08-27  281  	}
bf3baca6c James Ban     2014-08-27  282  
bf3baca6c James Ban     2014-08-27  283  	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
bf3baca6c James Ban     2014-08-27  284  	if (!pdata)
bf3baca6c James Ban     2014-08-27  285  		return ERR_PTR(-ENOMEM);
bf3baca6c James Ban     2014-08-27  286  
bf3baca6c James Ban     2014-08-27  287  	pdata->num_buck = num;
bf3baca6c James Ban     2014-08-27  288  
bf3baca6c James Ban     2014-08-27  289  	n = 0;
bf3baca6c James Ban     2014-08-27  290  	for (i = 0; i < ARRAY_SIZE(da9211_matches); i++) {
bf3baca6c James Ban     2014-08-27  291  		if (!da9211_matches[i].init_data)
bf3baca6c James Ban     2014-08-27  292  			continue;
bf3baca6c James Ban     2014-08-27  293  
bf3baca6c James Ban     2014-08-27  294  		pdata->init_data[n] = da9211_matches[i].init_data;
076c3b8e0 James Ban     2015-01-16  295  		pdata->reg_node[n] = da9211_matches[i].of_node;
c99c3a93a Linus Walleij 2018-11-27 @296  		pdata->gpiod_ren[n] = gpiod_get_from_of_node(dev,
11da04af0 Linus Walleij 2018-02-12 @297  				  da9211_matches[i].of_node,
11da04af0 Linus Walleij 2018-02-12 @298  				  "enable",
11da04af0 Linus Walleij 2018-02-12  299  				  0,
63239e4bf Linus Walleij 2018-10-15 @300  				  GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
11da04af0 Linus Walleij 2018-02-12  301  				  "da9211-enable");
bf3baca6c James Ban     2014-08-27  302  		n++;
c2a946e07 Fengguang Wu  2014-08-29  303  	}
bf3baca6c James Ban     2014-08-27  304  
bf3baca6c James Ban     2014-08-27  305  	return pdata;
bf3baca6c James Ban     2014-08-27  306  }
bf3baca6c James Ban     2014-08-27  307  #else
bf3baca6c James Ban     2014-08-27  308  static struct da9211_pdata *da9211_parse_regulators_dt(
bf3baca6c James Ban     2014-08-27  309  		struct device *dev)
bf3baca6c James Ban     2014-08-27  310  {
bf3baca6c James Ban     2014-08-27  311  	return ERR_PTR(-ENODEV);
bf3baca6c James Ban     2014-08-27  312  }
bf3baca6c James Ban     2014-08-27  313  #endif
bf3baca6c James Ban     2014-08-27  314  

:::::: The code at line 296 was first introduced by commit
:::::: c99c3a93a581d7575817b7b344a260b6b72245a2 regulator: da9211: Let core handle GPIO descriptors

:::::: 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