Re: [PATCH 1/7] regulator: s5m8767: switch to using devm_fwnode_gpiod_get

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

 



Hi Dmitry,

I love your patch! Perhaps something to improve:

[auto build test WARNING on regulator/for-next]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/regulator-switch-to-using-devm_-fwnode_gpiod_get_index/20191005-085020
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_pdata':
   drivers/regulator/s5m8767.c:570:30: error: implicit declaration of function 'devm_fwnode_gpiod_get'; did you mean 'devm_gpiod_get'? [-Werror=implicit-function-declaration]
      rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
                                 ^~~~~~~~~~~~~~~~~~~~~
                                 devm_gpiod_get
>> drivers/regulator/s5m8767.c:570:28: warning: assignment to 'struct gpio_desc *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
                               ^
   cc1: some warnings being treated as errors

vim +570 drivers/regulator/s5m8767.c

   519	
   520	static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
   521						struct sec_platform_data *pdata)
   522	{
   523		struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
   524		struct device_node *pmic_np, *regulators_np, *reg_np;
   525		struct sec_regulator_data *rdata;
   526		struct sec_opmode_data *rmode;
   527		unsigned int i, dvs_voltage_nr = 8, ret;
   528	
   529		pmic_np = iodev->dev->of_node;
   530		if (!pmic_np) {
   531			dev_err(iodev->dev, "could not find pmic sub-node\n");
   532			return -ENODEV;
   533		}
   534	
   535		regulators_np = of_get_child_by_name(pmic_np, "regulators");
   536		if (!regulators_np) {
   537			dev_err(iodev->dev, "could not find regulators sub-node\n");
   538			return -EINVAL;
   539		}
   540	
   541		/* count the number of regulators to be supported in pmic */
   542		pdata->num_regulators = of_get_child_count(regulators_np);
   543	
   544		rdata = devm_kcalloc(&pdev->dev,
   545				     pdata->num_regulators, sizeof(*rdata),
   546				     GFP_KERNEL);
   547		if (!rdata)
   548			return -ENOMEM;
   549	
   550		rmode = devm_kcalloc(&pdev->dev,
   551				     pdata->num_regulators, sizeof(*rmode),
   552				     GFP_KERNEL);
   553		if (!rmode)
   554			return -ENOMEM;
   555	
   556		pdata->regulators = rdata;
   557		pdata->opmode = rmode;
   558		for_each_child_of_node(regulators_np, reg_np) {
   559			for (i = 0; i < ARRAY_SIZE(regulators); i++)
   560				if (of_node_name_eq(reg_np, regulators[i].name))
   561					break;
   562	
   563			if (i == ARRAY_SIZE(regulators)) {
   564				dev_warn(iodev->dev,
   565				"don't know how to configure regulator %pOFn\n",
   566				reg_np);
   567				continue;
   568			}
   569	
 > 570			rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
   571				&pdev->dev,
   572				of_fwnode_handle(reg_np),
   573				"s5m8767,pmic-ext-control",
   574				GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
   575				"s5m8767");
   576			if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT)
   577				rdata->ext_control_gpiod = NULL;
   578			else if (IS_ERR(rdata->ext_control_gpiod))
   579				return PTR_ERR(rdata->ext_control_gpiod);
   580	
   581			rdata->id = i;
   582			rdata->initdata = of_get_regulator_init_data(
   583							&pdev->dev, reg_np,
   584							&regulators[i]);
   585			rdata->reg_node = reg_np;
   586			rdata++;
   587			rmode->id = i;
   588			if (of_property_read_u32(reg_np, "op_mode",
   589					&rmode->mode)) {
   590				dev_warn(iodev->dev,
   591					"no op_mode property property at %pOF\n",
   592					reg_np);
   593	
   594				rmode->mode = S5M8767_OPMODE_NORMAL_MODE;
   595			}
   596			rmode++;
   597		}
   598	
   599		of_node_put(regulators_np);
   600	
   601		if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL)) {
   602			pdata->buck2_gpiodvs = true;
   603	
   604			if (of_property_read_u32_array(pmic_np,
   605					"s5m8767,pmic-buck2-dvs-voltage",
   606					pdata->buck2_voltage, dvs_voltage_nr)) {
   607				dev_err(iodev->dev, "buck2 voltages not specified\n");
   608				return -EINVAL;
   609			}
   610		}
   611	
   612		if (of_get_property(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs", NULL)) {
   613			pdata->buck3_gpiodvs = true;
   614	
   615			if (of_property_read_u32_array(pmic_np,
   616					"s5m8767,pmic-buck3-dvs-voltage",
   617					pdata->buck3_voltage, dvs_voltage_nr)) {
   618				dev_err(iodev->dev, "buck3 voltages not specified\n");
   619				return -EINVAL;
   620			}
   621		}
   622	
   623		if (of_get_property(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs", NULL)) {
   624			pdata->buck4_gpiodvs = true;
   625	
   626			if (of_property_read_u32_array(pmic_np,
   627					"s5m8767,pmic-buck4-dvs-voltage",
   628					pdata->buck4_voltage, dvs_voltage_nr)) {
   629				dev_err(iodev->dev, "buck4 voltages not specified\n");
   630				return -EINVAL;
   631			}
   632		}
   633	
   634		if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
   635							pdata->buck4_gpiodvs) {
   636			ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
   637			if (ret)
   638				return -EINVAL;
   639	
   640			if (of_property_read_u32(pmic_np,
   641					"s5m8767,pmic-buck-default-dvs-idx",
   642					&pdata->buck_default_idx)) {
   643				pdata->buck_default_idx = 0;
   644			} else {
   645				if (pdata->buck_default_idx >= 8) {
   646					pdata->buck_default_idx = 0;
   647					dev_info(iodev->dev,
   648					"invalid value for default dvs index, use 0\n");
   649				}
   650			}
   651		}
   652	
   653		ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np);
   654		if (ret)
   655			return -EINVAL;
   656	
   657		if (of_get_property(pmic_np, "s5m8767,pmic-buck2-ramp-enable", NULL))
   658			pdata->buck2_ramp_enable = true;
   659	
   660		if (of_get_property(pmic_np, "s5m8767,pmic-buck3-ramp-enable", NULL))
   661			pdata->buck3_ramp_enable = true;
   662	
   663		if (of_get_property(pmic_np, "s5m8767,pmic-buck4-ramp-enable", NULL))
   664			pdata->buck4_ramp_enable = true;
   665	
   666		if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable
   667				|| pdata->buck4_ramp_enable) {
   668			if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
   669					&pdata->buck_ramp_delay))
   670				pdata->buck_ramp_delay = 0;
   671		}
   672	
   673		return 0;
   674	}
   675	#else
   676	static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
   677						struct sec_platform_data *pdata)
   678	{
   679		return 0;
   680	}
   681	#endif /* CONFIG_OF */
   682	

---
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 SoC Development]     [Linux Rockchip Development]     [Linux for Synopsys ARC Processors]    
  • [Linux on Unisoc (RDA Micro) SoCs]     [Linux Actions SoC]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  •   Powered by Linux