[gpio:gpio-descriptors-regulator-fixup 10/10] drivers//regulator/tps65090-regulator.c:379:43: 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: 9147361eb80075e5eb6cae3ddec80c7dd3c9e0d9 [10/10] regulator: tps65090: Let core handle GPIO descriptors
config: i386-randconfig-x072-201847 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 9147361eb80075e5eb6cae3ddec80c7dd3c9e0d9
        # save the attached .config to linux build tree
        make ARCH=i386 

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

   drivers//regulator/tps65090-regulator.c: In function 'tps65090_parse_dt_reg_data':
>> drivers//regulator/tps65090-regulator.c:379:43: error: passing argument 1 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
       rpdata->gpiod = gpiod_get_from_of_node(&pdev->dev,
                                              ^
   In file included from drivers//regulator/tps65090-regulator.c:23: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/tps65090-regulator.c:380:7: error: passing argument 2 of 'gpiod_get_from_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
          tps65090_matches[idx].of_node,
          ^~~~~~~~~~~~~~~~
   In file included from drivers//regulator/tps65090-regulator.c:23: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/tps65090-regulator.c:381:7: warning: passing argument 3 of 'gpiod_get_from_of_node' makes integer from pointer without a cast [-Wint-conversion]
          "dcdc-ext-control-gpios", 0,
          ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers//regulator/tps65090-regulator.c:23: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/tps65090-regulator.c:382:7: error: incompatible type for argument 5 of 'gpiod_get_from_of_node'
          gflags,
          ^~~~~~
   In file included from drivers//regulator/tps65090-regulator.c:23:0:
   include/linux/gpio/consumer.h:175:19: note: expected 'const char *' but argument is of type 'enum gpiod_flags'
    struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
                      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers//regulator/tps65090-regulator.c:379:20: error: too many arguments to function 'gpiod_get_from_of_node'
       rpdata->gpiod = gpiod_get_from_of_node(&pdev->dev,
                       ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers//regulator/tps65090-regulator.c:23: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 +379 drivers//regulator/tps65090-regulator.c

   318	
   319	static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
   320			struct platform_device *pdev,
   321			struct of_regulator_match **tps65090_reg_matches)
   322	{
   323		struct tps65090_platform_data *tps65090_pdata;
   324		struct device_node *np = pdev->dev.parent->of_node;
   325		struct device_node *regulators;
   326		int idx = 0, ret;
   327		struct tps65090_regulator_plat_data *reg_pdata;
   328	
   329		tps65090_pdata = devm_kzalloc(&pdev->dev, sizeof(*tps65090_pdata),
   330					GFP_KERNEL);
   331		if (!tps65090_pdata)
   332			return ERR_PTR(-ENOMEM);
   333	
   334		reg_pdata = devm_kcalloc(&pdev->dev,
   335					 TPS65090_REGULATOR_MAX, sizeof(*reg_pdata),
   336					 GFP_KERNEL);
   337		if (!reg_pdata)
   338			return ERR_PTR(-ENOMEM);
   339	
   340		regulators = of_get_child_by_name(np, "regulators");
   341		if (!regulators) {
   342			dev_err(&pdev->dev, "regulator node not found\n");
   343			return ERR_PTR(-ENODEV);
   344		}
   345	
   346		ret = of_regulator_match(&pdev->dev, regulators, tps65090_matches,
   347				ARRAY_SIZE(tps65090_matches));
   348		of_node_put(regulators);
   349		if (ret < 0) {
   350			dev_err(&pdev->dev,
   351				"Error parsing regulator init data: %d\n", ret);
   352			return ERR_PTR(ret);
   353		}
   354	
   355		*tps65090_reg_matches = tps65090_matches;
   356		for (idx = 0; idx < ARRAY_SIZE(tps65090_matches); idx++) {
   357			struct regulator_init_data *ri_data;
   358			struct tps65090_regulator_plat_data *rpdata;
   359	
   360			rpdata = &reg_pdata[idx];
   361			ri_data = tps65090_matches[idx].init_data;
   362			if (!ri_data || !tps65090_matches[idx].of_node)
   363				continue;
   364	
   365			rpdata->reg_init_data = ri_data;
   366			rpdata->enable_ext_control = of_property_read_bool(
   367						tps65090_matches[idx].of_node,
   368						"ti,enable-ext-control");
   369			if (rpdata->enable_ext_control) {
   370				enum gpiod_flags gflags;
   371	
   372				if (ri_data->constraints.always_on ||
   373				    ri_data->constraints.boot_on)
   374					gflags = GPIOD_OUT_HIGH;
   375				else
   376					gflags = GPIOD_OUT_LOW;
   377				gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
   378	
 > 379				rpdata->gpiod = gpiod_get_from_of_node(&pdev->dev,
 > 380							tps65090_matches[idx].of_node,
 > 381							"dcdc-ext-control-gpios", 0,
 > 382							gflags,
   383							"tps65090");
   384				if (IS_ERR(rpdata->gpiod))
   385					return ERR_CAST(rpdata->gpiod);
   386				if (!rpdata->gpiod)
   387					dev_err(&pdev->dev,
   388						"could not find DCDC external control GPIO\n");
   389			}
   390	
   391			if (of_property_read_u32(tps65090_matches[idx].of_node,
   392						 "ti,overcurrent-wait",
   393						 &rpdata->overcurrent_wait) == 0)
   394				rpdata->overcurrent_wait_valid = true;
   395	
   396			tps65090_pdata->reg_pdata[idx] = rpdata;
   397		}
   398		return tps65090_pdata;
   399	}
   400	#else
   401	static inline struct tps65090_platform_data *tps65090_parse_dt_reg_data(
   402				struct platform_device *pdev,
   403				struct of_regulator_match **tps65090_reg_matches)
   404	{
   405		*tps65090_reg_matches = NULL;
   406		return NULL;
   407	}
   408	#endif
   409	

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