public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [broonie-ci:v5_20240507_wens_regulator_sun20i_add_allwinner_d1_ldos_driver 11/11] drivers/regulator/sun20i-regulator.c:111:9: error: call to undeclared function 'of_device_get_match_data'; ISO C99 and later do not support implicit function declarations
@ 2024-05-09  2:51 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-05-09  2:51 UTC (permalink / raw)
  To: Samuel Holland
  Cc: llvm, oe-kbuild-all, Mark Brown, Andre Przywara, Jernej Skrabec,
	Chen-Yu Tsai

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ci.git v5_20240507_wens_regulator_sun20i_add_allwinner_d1_ldos_driver
head:   d76a5d182fa92d5270e5689baa26841f7ac45228
commit: d76a5d182fa92d5270e5689baa26841f7ac45228 [11/11] regulator: sun20i: Add Allwinner D1 LDOs driver
config: riscv-defconfig (https://download.01.org/0day-ci/archive/20240509/202405091005.QcdWxIfd-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 0ab4458df0688955620b72cc2c72a32dffad3615)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240509/202405091005.QcdWxIfd-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/202405091005.QcdWxIfd-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/regulator/sun20i-regulator.c:11:
   In file included from include/linux/regulator/driver.h:18:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:21:
   In file included from arch/riscv/include/asm/sections.h:9:
   In file included from include/linux/mm.h:2208:
   include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     522 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/regulator/sun20i-regulator.c:111:9: error: call to undeclared function 'of_device_get_match_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     111 |         data = of_device_get_match_data(dev);
         |                ^
>> drivers/regulator/sun20i-regulator.c:111:7: error: incompatible integer to pointer conversion assigning to 'const struct sun20i_regulator_data *' from 'int' [-Wint-conversion]
     111 |         data = of_device_get_match_data(dev);
         |              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/sun20i-regulator.c:136:59: error: array has incomplete element type 'const struct of_device_id'
     136 | static const struct of_device_id sun20i_regulator_of_match[] = {
         |                                                           ^
   include/linux/device/driver.h:106:15: note: forward declaration of 'struct of_device_id'
     106 |         const struct of_device_id       *of_match_table;
         |                      ^
   1 warning and 3 errors generated.


vim +/of_device_get_match_data +111 drivers/regulator/sun20i-regulator.c

   103	
   104	static int sun20i_regulator_probe(struct platform_device *pdev)
   105	{
   106		const struct sun20i_regulator_data *data;
   107		struct device *dev = &pdev->dev;
   108		struct regulator_config config;
   109		struct regmap *regmap;
   110	
 > 111		data = of_device_get_match_data(dev);
   112		if (!data)
   113			return -EINVAL;
   114	
   115		regmap = sun20i_regulator_get_regmap(dev);
   116		if (IS_ERR(regmap))
   117			return dev_err_probe(dev, PTR_ERR(regmap), "Failed to get regmap\n");
   118	
   119		config = (struct regulator_config) {
   120			.dev	= dev,
   121			.regmap	= regmap,
   122		};
   123	
   124		for (unsigned int i = 0; i < data->ndescs; ++i) {
   125			const struct regulator_desc *desc = &data->descs[i];
   126			struct regulator_dev *rdev;
   127	
   128			rdev = devm_regulator_register(dev, desc, &config);
   129			if (IS_ERR(rdev))
   130				return PTR_ERR(rdev);
   131		}
   132	
   133		return 0;
   134	}
   135	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-09  2:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09  2:51 [broonie-ci:v5_20240507_wens_regulator_sun20i_add_allwinner_d1_ldos_driver 11/11] drivers/regulator/sun20i-regulator.c:111:9: error: call to undeclared function 'of_device_get_match_data'; ISO C99 and later do not support implicit function declarations kernel test robot

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