All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Aleksandr Shubin <privatesub2@gmail.com>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
	"Aleksandr Shubin" <privatesub2@gmail.com>,
	"Brandon Cheo Fusi" <fusibrandon13@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Cristian Ciocaltea" <cristian.ciocaltea@collabora.com>,
	"Maksim Kiselev" <bigunclemax@gmail.com>,
	"John Watts" <contact@jookia.org>,
	linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v7 2/3] pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support
Date: Fri, 26 Jan 2024 07:13:43 +0800	[thread overview]
Message-ID: <202401260632.l2X5DTxa-lkp@intel.com> (raw)
In-Reply-To: <20240125072032.1151383-3-privatesub2@gmail.com>

Hi Aleksandr,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on sunxi/sunxi/for-next linus/master v6.8-rc1 next-20240125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Aleksandr-Shubin/dt-bindings-pwm-Add-binding-for-Allwinner-D1-T113-S3-R329-PWM-controller/20240125-152445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20240125072032.1151383-3-privatesub2%40gmail.com
patch subject: [PATCH v7 2/3] pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240126/202401260632.l2X5DTxa-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401260632.l2X5DTxa-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/202401260632.l2X5DTxa-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pwm/pwm-sun20i.c:288:10: error: 'const struct pwm_ops' has no member named 'owner'
     288 |         .owner = THIS_MODULE,
         |          ^~~~~
   In file included from include/linux/printk.h:6,
                    from include/linux/kernel.h:31,
                    from include/linux/clk.h:13,
                    from drivers/pwm/pwm-sun20i.c:14:
>> include/linux/init.h:186:21: error: initialization of 'int (*)(struct pwm_chip *, struct pwm_device *, struct pwm_state *)' from incompatible pointer type 'struct module *' [-Werror=incompatible-pointer-types]
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: note: (near initialization for 'sun20i_pwm_ops.get_state')
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: warning: initialized field overwritten [-Woverride-init]
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: note: (near initialization for 'sun20i_pwm_ops.get_state')
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:297:36: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
     297 | static int sun20i_pwm_probe(struct platform_device *pdev)
         |                                    ^~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: In function 'sun20i_pwm_probe':
>> drivers/pwm/pwm-sun20i.c:302:23: error: implicit declaration of function 'devm_kzalloc' [-Werror=implicit-function-declaration]
     302 |         sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
         |                       ^~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:302:41: error: invalid use of undefined type 'struct platform_device'
     302 |         sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
         |                                         ^~
>> drivers/pwm/pwm-sun20i.c:306:29: error: implicit declaration of function 'devm_platform_ioremap_resource' [-Werror=implicit-function-declaration]
     306 |         sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:306:27: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     306 |         sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
         |                           ^
   drivers/pwm/pwm-sun20i.c:310:58: error: invalid use of undefined type 'struct platform_device'
     310 |         sun20i_chip->clk_bus = devm_clk_get_enabled(&pdev->dev, "bus");
         |                                                          ^~
>> drivers/pwm/pwm-sun20i.c:312:24: error: implicit declaration of function 'dev_err_probe' [-Werror=implicit-function-declaration]
     312 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
         |                        ^~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:312:43: error: invalid use of undefined type 'struct platform_device'
     312 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:315:59: error: invalid use of undefined type 'struct platform_device'
     315 |         sun20i_chip->clk_hosc = devm_clk_get_enabled(&pdev->dev, "hosc");
         |                                                           ^~
   drivers/pwm/pwm-sun20i.c:317:43: error: invalid use of undefined type 'struct platform_device'
     317 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_hosc),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:320:59: error: invalid use of undefined type 'struct platform_device'
     320 |         sun20i_chip->clk_apb0 = devm_clk_get_enabled(&pdev->dev, "apb0");
         |                                                           ^~
   drivers/pwm/pwm-sun20i.c:322:43: error: invalid use of undefined type 'struct platform_device'
     322 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_apb0),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:325:66: error: invalid use of undefined type 'struct platform_device'
     325 |         sun20i_chip->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
         |                                                                  ^~
   drivers/pwm/pwm-sun20i.c:327:43: error: invalid use of undefined type 'struct platform_device'
     327 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->rst),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:330:40: error: invalid use of undefined type 'struct platform_device'
     330 |         ret = of_property_read_u32(pdev->dev.of_node, "allwinner,pwm-channels",
         |                                        ^~
   drivers/pwm/pwm-sun20i.c:341:43: error: invalid use of undefined type 'struct platform_device'
     341 |                 return dev_err_probe(&pdev->dev, ret, "failed to deassert reset\n");
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:343:38: error: invalid use of undefined type 'struct platform_device'
     343 |         sun20i_chip->chip.dev = &pdev->dev;
         |                                      ^~
   drivers/pwm/pwm-sun20i.c:351:43: error: invalid use of undefined type 'struct platform_device'
     351 |                 return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");
         |                                           ^~
>> drivers/pwm/pwm-sun20i.c:354:9: error: implicit declaration of function 'platform_set_drvdata' [-Werror=implicit-function-declaration]
     354 |         platform_set_drvdata(pdev, sun20i_chip);
         |         ^~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: At top level:
   drivers/pwm/pwm-sun20i.c:359:38: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
     359 | static void sun20i_pwm_remove(struct platform_device *pdev)
         |                                      ^~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: In function 'sun20i_pwm_remove':
>> drivers/pwm/pwm-sun20i.c:361:47: error: implicit declaration of function 'platform_get_drvdata' [-Werror=implicit-function-declaration]
     361 |         struct sun20i_pwm_chip *sun20i_chip = platform_get_drvdata(pdev);
         |                                               ^~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:361:47: warning: initialization of 'struct sun20i_pwm_chip *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   drivers/pwm/pwm-sun20i.c: At top level:
>> drivers/pwm/pwm-sun20i.c:368:15: error: variable 'sun20i_pwm_driver' has initializer but incomplete type
     368 | static struct platform_driver sun20i_pwm_driver = {
         |               ^~~~~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:369:10: error: 'struct platform_driver' has no member named 'driver'
     369 |         .driver = {
         |          ^~~~~~
>> drivers/pwm/pwm-sun20i.c:369:19: error: extra brace group at end of initializer
     369 |         .driver = {
         |                   ^
   drivers/pwm/pwm-sun20i.c:369:19: note: (near initialization for 'sun20i_pwm_driver')
   drivers/pwm/pwm-sun20i.c:369:19: warning: excess elements in struct initializer
   drivers/pwm/pwm-sun20i.c:369:19: note: (near initialization for 'sun20i_pwm_driver')
>> drivers/pwm/pwm-sun20i.c:373:10: error: 'struct platform_driver' has no member named 'probe'
     373 |         .probe = sun20i_pwm_probe,
         |          ^~~~~
   drivers/pwm/pwm-sun20i.c:373:18: warning: excess elements in struct initializer
     373 |         .probe = sun20i_pwm_probe,
         |                  ^~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:373:18: note: (near initialization for 'sun20i_pwm_driver')
>> drivers/pwm/pwm-sun20i.c:374:10: error: 'struct platform_driver' has no member named 'remove_new'
     374 |         .remove_new = sun20i_pwm_remove,
         |          ^~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:374:23: warning: excess elements in struct initializer
     374 |         .remove_new = sun20i_pwm_remove,
         |                       ^~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:374:23: note: (near initialization for 'sun20i_pwm_driver')
   drivers/pwm/pwm-sun20i.c:376:1: warning: data definition has no type or storage class
     376 | module_platform_driver(sun20i_pwm_driver);
         | ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:376:1: error: type defaults to 'int' in declaration of 'module_platform_driver' [-Werror=implicit-int]
   drivers/pwm/pwm-sun20i.c:376:1: warning: parameter names (without types) in function declaration
>> drivers/pwm/pwm-sun20i.c:368:31: error: storage size of 'sun20i_pwm_driver' isn't known
     368 | static struct platform_driver sun20i_pwm_driver = {
         |                               ^~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:368:31: warning: 'sun20i_pwm_driver' defined but not used [-Wunused-variable]
   cc1: some warnings being treated as errors


vim +288 drivers/pwm/pwm-sun20i.c

   284	
   285	static const struct pwm_ops sun20i_pwm_ops = {
   286		.get_state = sun20i_pwm_get_state,
   287		.apply = sun20i_pwm_apply,
 > 288		.owner = THIS_MODULE,
   289	};
   290	
   291	static const struct of_device_id sun20i_pwm_dt_ids[] = {
   292		{ .compatible = "allwinner,sun20i-d1-pwm" },
   293		{ },
   294	};
   295	MODULE_DEVICE_TABLE(of, sun20i_pwm_dt_ids);
   296	
   297	static int sun20i_pwm_probe(struct platform_device *pdev)
   298	{
   299		struct sun20i_pwm_chip *sun20i_chip;
   300		int ret;
   301	
 > 302		sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
   303		if (!sun20i_chip)
   304			return -ENOMEM;
   305	
 > 306		sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
   307		if (IS_ERR(sun20i_chip->base))
   308			return PTR_ERR(sun20i_chip->base);
   309	
   310		sun20i_chip->clk_bus = devm_clk_get_enabled(&pdev->dev, "bus");
   311		if (IS_ERR(sun20i_chip->clk_bus))
 > 312			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
   313					     "failed to get bus clock\n");
   314	
   315		sun20i_chip->clk_hosc = devm_clk_get_enabled(&pdev->dev, "hosc");
   316		if (IS_ERR(sun20i_chip->clk_hosc))
   317			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_hosc),
   318					     "failed to get hosc clock\n");
   319	
   320		sun20i_chip->clk_apb0 = devm_clk_get_enabled(&pdev->dev, "apb0");
   321		if (IS_ERR(sun20i_chip->clk_apb0))
   322			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_apb0),
   323					     "failed to get apb0 clock\n");
   324	
   325		sun20i_chip->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
   326		if (IS_ERR(sun20i_chip->rst))
   327			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->rst),
   328					     "failed to get bus reset\n");
   329	
   330		ret = of_property_read_u32(pdev->dev.of_node, "allwinner,pwm-channels",
   331					   &sun20i_chip->chip.npwm);
   332		if (ret)
   333			sun20i_chip->chip.npwm = 8;
   334	
   335		if (sun20i_chip->chip.npwm > 16)
   336			sun20i_chip->chip.npwm = 16;
   337	
   338		/* Deassert reset */
   339		ret = reset_control_deassert(sun20i_chip->rst);
   340		if (ret)
   341			return dev_err_probe(&pdev->dev, ret, "failed to deassert reset\n");
   342	
   343		sun20i_chip->chip.dev = &pdev->dev;
   344		sun20i_chip->chip.ops = &sun20i_pwm_ops;
   345	
   346		mutex_init(&sun20i_chip->mutex);
   347	
   348		ret = pwmchip_add(&sun20i_chip->chip);
   349		if (ret < 0) {
   350			reset_control_assert(sun20i_chip->rst);
   351			return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");
   352		}
   353	
 > 354		platform_set_drvdata(pdev, sun20i_chip);
   355	
   356		return 0;
   357	}
   358	
   359	static void sun20i_pwm_remove(struct platform_device *pdev)
   360	{
 > 361		struct sun20i_pwm_chip *sun20i_chip = platform_get_drvdata(pdev);
   362	
   363		pwmchip_remove(&sun20i_chip->chip);
   364	
   365		reset_control_assert(sun20i_chip->rst);
   366	}
   367	
 > 368	static struct platform_driver sun20i_pwm_driver = {
 > 369		.driver = {
   370			.name = "sun20i-pwm",
   371			.of_match_table = sun20i_pwm_dt_ids,
   372		},
 > 373		.probe = sun20i_pwm_probe,
 > 374		.remove_new = sun20i_pwm_remove,
   375	};
 > 376	module_platform_driver(sun20i_pwm_driver);
   377	

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Aleksandr Shubin <privatesub2@gmail.com>, linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"John Watts" <contact@jookia.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	linux-riscv@lists.infradead.org,
	"Samuel Holland" <samuel@sholland.org>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-sunxi@lists.linux.dev, linux-pwm@vger.kernel.org,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Aleksandr Shubin" <privatesub2@gmail.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	oe-kbuild-all@lists.linux.dev,
	"Maksim Kiselev" <bigunclemax@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	"Brandon Cheo Fusi" <fusibrandon13@gmail.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>
Subject: Re: [PATCH v7 2/3] pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support
Date: Fri, 26 Jan 2024 07:13:43 +0800	[thread overview]
Message-ID: <202401260632.l2X5DTxa-lkp@intel.com> (raw)
In-Reply-To: <20240125072032.1151383-3-privatesub2@gmail.com>

Hi Aleksandr,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on sunxi/sunxi/for-next linus/master v6.8-rc1 next-20240125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Aleksandr-Shubin/dt-bindings-pwm-Add-binding-for-Allwinner-D1-T113-S3-R329-PWM-controller/20240125-152445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20240125072032.1151383-3-privatesub2%40gmail.com
patch subject: [PATCH v7 2/3] pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240126/202401260632.l2X5DTxa-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401260632.l2X5DTxa-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/202401260632.l2X5DTxa-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pwm/pwm-sun20i.c:288:10: error: 'const struct pwm_ops' has no member named 'owner'
     288 |         .owner = THIS_MODULE,
         |          ^~~~~
   In file included from include/linux/printk.h:6,
                    from include/linux/kernel.h:31,
                    from include/linux/clk.h:13,
                    from drivers/pwm/pwm-sun20i.c:14:
>> include/linux/init.h:186:21: error: initialization of 'int (*)(struct pwm_chip *, struct pwm_device *, struct pwm_state *)' from incompatible pointer type 'struct module *' [-Werror=incompatible-pointer-types]
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: note: (near initialization for 'sun20i_pwm_ops.get_state')
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: warning: initialized field overwritten [-Woverride-init]
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: note: (near initialization for 'sun20i_pwm_ops.get_state')
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:297:36: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
     297 | static int sun20i_pwm_probe(struct platform_device *pdev)
         |                                    ^~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: In function 'sun20i_pwm_probe':
>> drivers/pwm/pwm-sun20i.c:302:23: error: implicit declaration of function 'devm_kzalloc' [-Werror=implicit-function-declaration]
     302 |         sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
         |                       ^~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:302:41: error: invalid use of undefined type 'struct platform_device'
     302 |         sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
         |                                         ^~
>> drivers/pwm/pwm-sun20i.c:306:29: error: implicit declaration of function 'devm_platform_ioremap_resource' [-Werror=implicit-function-declaration]
     306 |         sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:306:27: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     306 |         sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
         |                           ^
   drivers/pwm/pwm-sun20i.c:310:58: error: invalid use of undefined type 'struct platform_device'
     310 |         sun20i_chip->clk_bus = devm_clk_get_enabled(&pdev->dev, "bus");
         |                                                          ^~
>> drivers/pwm/pwm-sun20i.c:312:24: error: implicit declaration of function 'dev_err_probe' [-Werror=implicit-function-declaration]
     312 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
         |                        ^~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:312:43: error: invalid use of undefined type 'struct platform_device'
     312 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:315:59: error: invalid use of undefined type 'struct platform_device'
     315 |         sun20i_chip->clk_hosc = devm_clk_get_enabled(&pdev->dev, "hosc");
         |                                                           ^~
   drivers/pwm/pwm-sun20i.c:317:43: error: invalid use of undefined type 'struct platform_device'
     317 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_hosc),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:320:59: error: invalid use of undefined type 'struct platform_device'
     320 |         sun20i_chip->clk_apb0 = devm_clk_get_enabled(&pdev->dev, "apb0");
         |                                                           ^~
   drivers/pwm/pwm-sun20i.c:322:43: error: invalid use of undefined type 'struct platform_device'
     322 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_apb0),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:325:66: error: invalid use of undefined type 'struct platform_device'
     325 |         sun20i_chip->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
         |                                                                  ^~
   drivers/pwm/pwm-sun20i.c:327:43: error: invalid use of undefined type 'struct platform_device'
     327 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->rst),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:330:40: error: invalid use of undefined type 'struct platform_device'
     330 |         ret = of_property_read_u32(pdev->dev.of_node, "allwinner,pwm-channels",
         |                                        ^~
   drivers/pwm/pwm-sun20i.c:341:43: error: invalid use of undefined type 'struct platform_device'
     341 |                 return dev_err_probe(&pdev->dev, ret, "failed to deassert reset\n");
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:343:38: error: invalid use of undefined type 'struct platform_device'
     343 |         sun20i_chip->chip.dev = &pdev->dev;
         |                                      ^~
   drivers/pwm/pwm-sun20i.c:351:43: error: invalid use of undefined type 'struct platform_device'
     351 |                 return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");
         |                                           ^~
>> drivers/pwm/pwm-sun20i.c:354:9: error: implicit declaration of function 'platform_set_drvdata' [-Werror=implicit-function-declaration]
     354 |         platform_set_drvdata(pdev, sun20i_chip);
         |         ^~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: At top level:
   drivers/pwm/pwm-sun20i.c:359:38: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
     359 | static void sun20i_pwm_remove(struct platform_device *pdev)
         |                                      ^~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: In function 'sun20i_pwm_remove':
>> drivers/pwm/pwm-sun20i.c:361:47: error: implicit declaration of function 'platform_get_drvdata' [-Werror=implicit-function-declaration]
     361 |         struct sun20i_pwm_chip *sun20i_chip = platform_get_drvdata(pdev);
         |                                               ^~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:361:47: warning: initialization of 'struct sun20i_pwm_chip *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   drivers/pwm/pwm-sun20i.c: At top level:
>> drivers/pwm/pwm-sun20i.c:368:15: error: variable 'sun20i_pwm_driver' has initializer but incomplete type
     368 | static struct platform_driver sun20i_pwm_driver = {
         |               ^~~~~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:369:10: error: 'struct platform_driver' has no member named 'driver'
     369 |         .driver = {
         |          ^~~~~~
>> drivers/pwm/pwm-sun20i.c:369:19: error: extra brace group at end of initializer
     369 |         .driver = {
         |                   ^
   drivers/pwm/pwm-sun20i.c:369:19: note: (near initialization for 'sun20i_pwm_driver')
   drivers/pwm/pwm-sun20i.c:369:19: warning: excess elements in struct initializer
   drivers/pwm/pwm-sun20i.c:369:19: note: (near initialization for 'sun20i_pwm_driver')
>> drivers/pwm/pwm-sun20i.c:373:10: error: 'struct platform_driver' has no member named 'probe'
     373 |         .probe = sun20i_pwm_probe,
         |          ^~~~~
   drivers/pwm/pwm-sun20i.c:373:18: warning: excess elements in struct initializer
     373 |         .probe = sun20i_pwm_probe,
         |                  ^~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:373:18: note: (near initialization for 'sun20i_pwm_driver')
>> drivers/pwm/pwm-sun20i.c:374:10: error: 'struct platform_driver' has no member named 'remove_new'
     374 |         .remove_new = sun20i_pwm_remove,
         |          ^~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:374:23: warning: excess elements in struct initializer
     374 |         .remove_new = sun20i_pwm_remove,
         |                       ^~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:374:23: note: (near initialization for 'sun20i_pwm_driver')
   drivers/pwm/pwm-sun20i.c:376:1: warning: data definition has no type or storage class
     376 | module_platform_driver(sun20i_pwm_driver);
         | ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:376:1: error: type defaults to 'int' in declaration of 'module_platform_driver' [-Werror=implicit-int]
   drivers/pwm/pwm-sun20i.c:376:1: warning: parameter names (without types) in function declaration
>> drivers/pwm/pwm-sun20i.c:368:31: error: storage size of 'sun20i_pwm_driver' isn't known
     368 | static struct platform_driver sun20i_pwm_driver = {
         |                               ^~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:368:31: warning: 'sun20i_pwm_driver' defined but not used [-Wunused-variable]
   cc1: some warnings being treated as errors


vim +288 drivers/pwm/pwm-sun20i.c

   284	
   285	static const struct pwm_ops sun20i_pwm_ops = {
   286		.get_state = sun20i_pwm_get_state,
   287		.apply = sun20i_pwm_apply,
 > 288		.owner = THIS_MODULE,
   289	};
   290	
   291	static const struct of_device_id sun20i_pwm_dt_ids[] = {
   292		{ .compatible = "allwinner,sun20i-d1-pwm" },
   293		{ },
   294	};
   295	MODULE_DEVICE_TABLE(of, sun20i_pwm_dt_ids);
   296	
   297	static int sun20i_pwm_probe(struct platform_device *pdev)
   298	{
   299		struct sun20i_pwm_chip *sun20i_chip;
   300		int ret;
   301	
 > 302		sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
   303		if (!sun20i_chip)
   304			return -ENOMEM;
   305	
 > 306		sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
   307		if (IS_ERR(sun20i_chip->base))
   308			return PTR_ERR(sun20i_chip->base);
   309	
   310		sun20i_chip->clk_bus = devm_clk_get_enabled(&pdev->dev, "bus");
   311		if (IS_ERR(sun20i_chip->clk_bus))
 > 312			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
   313					     "failed to get bus clock\n");
   314	
   315		sun20i_chip->clk_hosc = devm_clk_get_enabled(&pdev->dev, "hosc");
   316		if (IS_ERR(sun20i_chip->clk_hosc))
   317			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_hosc),
   318					     "failed to get hosc clock\n");
   319	
   320		sun20i_chip->clk_apb0 = devm_clk_get_enabled(&pdev->dev, "apb0");
   321		if (IS_ERR(sun20i_chip->clk_apb0))
   322			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_apb0),
   323					     "failed to get apb0 clock\n");
   324	
   325		sun20i_chip->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
   326		if (IS_ERR(sun20i_chip->rst))
   327			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->rst),
   328					     "failed to get bus reset\n");
   329	
   330		ret = of_property_read_u32(pdev->dev.of_node, "allwinner,pwm-channels",
   331					   &sun20i_chip->chip.npwm);
   332		if (ret)
   333			sun20i_chip->chip.npwm = 8;
   334	
   335		if (sun20i_chip->chip.npwm > 16)
   336			sun20i_chip->chip.npwm = 16;
   337	
   338		/* Deassert reset */
   339		ret = reset_control_deassert(sun20i_chip->rst);
   340		if (ret)
   341			return dev_err_probe(&pdev->dev, ret, "failed to deassert reset\n");
   342	
   343		sun20i_chip->chip.dev = &pdev->dev;
   344		sun20i_chip->chip.ops = &sun20i_pwm_ops;
   345	
   346		mutex_init(&sun20i_chip->mutex);
   347	
   348		ret = pwmchip_add(&sun20i_chip->chip);
   349		if (ret < 0) {
   350			reset_control_assert(sun20i_chip->rst);
   351			return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");
   352		}
   353	
 > 354		platform_set_drvdata(pdev, sun20i_chip);
   355	
   356		return 0;
   357	}
   358	
   359	static void sun20i_pwm_remove(struct platform_device *pdev)
   360	{
 > 361		struct sun20i_pwm_chip *sun20i_chip = platform_get_drvdata(pdev);
   362	
   363		pwmchip_remove(&sun20i_chip->chip);
   364	
   365		reset_control_assert(sun20i_chip->rst);
   366	}
   367	
 > 368	static struct platform_driver sun20i_pwm_driver = {
 > 369		.driver = {
   370			.name = "sun20i-pwm",
   371			.of_match_table = sun20i_pwm_dt_ids,
   372		},
 > 373		.probe = sun20i_pwm_probe,
 > 374		.remove_new = sun20i_pwm_remove,
   375	};
 > 376	module_platform_driver(sun20i_pwm_driver);
   377	

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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Aleksandr Shubin <privatesub2@gmail.com>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
	"Aleksandr Shubin" <privatesub2@gmail.com>,
	"Brandon Cheo Fusi" <fusibrandon13@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Cristian Ciocaltea" <cristian.ciocaltea@collabora.com>,
	"Maksim Kiselev" <bigunclemax@gmail.com>,
	"John Watts" <contact@jookia.org>,
	linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v7 2/3] pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support
Date: Fri, 26 Jan 2024 07:13:43 +0800	[thread overview]
Message-ID: <202401260632.l2X5DTxa-lkp@intel.com> (raw)
In-Reply-To: <20240125072032.1151383-3-privatesub2@gmail.com>

Hi Aleksandr,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on sunxi/sunxi/for-next linus/master v6.8-rc1 next-20240125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Aleksandr-Shubin/dt-bindings-pwm-Add-binding-for-Allwinner-D1-T113-S3-R329-PWM-controller/20240125-152445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20240125072032.1151383-3-privatesub2%40gmail.com
patch subject: [PATCH v7 2/3] pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240126/202401260632.l2X5DTxa-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401260632.l2X5DTxa-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/202401260632.l2X5DTxa-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pwm/pwm-sun20i.c:288:10: error: 'const struct pwm_ops' has no member named 'owner'
     288 |         .owner = THIS_MODULE,
         |          ^~~~~
   In file included from include/linux/printk.h:6,
                    from include/linux/kernel.h:31,
                    from include/linux/clk.h:13,
                    from drivers/pwm/pwm-sun20i.c:14:
>> include/linux/init.h:186:21: error: initialization of 'int (*)(struct pwm_chip *, struct pwm_device *, struct pwm_state *)' from incompatible pointer type 'struct module *' [-Werror=incompatible-pointer-types]
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: note: (near initialization for 'sun20i_pwm_ops.get_state')
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: warning: initialized field overwritten [-Woverride-init]
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   include/linux/init.h:186:21: note: (near initialization for 'sun20i_pwm_ops.get_state')
     186 | #define THIS_MODULE ((struct module *)0)
         |                     ^
   drivers/pwm/pwm-sun20i.c:288:18: note: in expansion of macro 'THIS_MODULE'
     288 |         .owner = THIS_MODULE,
         |                  ^~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:297:36: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
     297 | static int sun20i_pwm_probe(struct platform_device *pdev)
         |                                    ^~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: In function 'sun20i_pwm_probe':
>> drivers/pwm/pwm-sun20i.c:302:23: error: implicit declaration of function 'devm_kzalloc' [-Werror=implicit-function-declaration]
     302 |         sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
         |                       ^~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:302:41: error: invalid use of undefined type 'struct platform_device'
     302 |         sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
         |                                         ^~
>> drivers/pwm/pwm-sun20i.c:306:29: error: implicit declaration of function 'devm_platform_ioremap_resource' [-Werror=implicit-function-declaration]
     306 |         sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:306:27: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     306 |         sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
         |                           ^
   drivers/pwm/pwm-sun20i.c:310:58: error: invalid use of undefined type 'struct platform_device'
     310 |         sun20i_chip->clk_bus = devm_clk_get_enabled(&pdev->dev, "bus");
         |                                                          ^~
>> drivers/pwm/pwm-sun20i.c:312:24: error: implicit declaration of function 'dev_err_probe' [-Werror=implicit-function-declaration]
     312 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
         |                        ^~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:312:43: error: invalid use of undefined type 'struct platform_device'
     312 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:315:59: error: invalid use of undefined type 'struct platform_device'
     315 |         sun20i_chip->clk_hosc = devm_clk_get_enabled(&pdev->dev, "hosc");
         |                                                           ^~
   drivers/pwm/pwm-sun20i.c:317:43: error: invalid use of undefined type 'struct platform_device'
     317 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_hosc),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:320:59: error: invalid use of undefined type 'struct platform_device'
     320 |         sun20i_chip->clk_apb0 = devm_clk_get_enabled(&pdev->dev, "apb0");
         |                                                           ^~
   drivers/pwm/pwm-sun20i.c:322:43: error: invalid use of undefined type 'struct platform_device'
     322 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_apb0),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:325:66: error: invalid use of undefined type 'struct platform_device'
     325 |         sun20i_chip->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
         |                                                                  ^~
   drivers/pwm/pwm-sun20i.c:327:43: error: invalid use of undefined type 'struct platform_device'
     327 |                 return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->rst),
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:330:40: error: invalid use of undefined type 'struct platform_device'
     330 |         ret = of_property_read_u32(pdev->dev.of_node, "allwinner,pwm-channels",
         |                                        ^~
   drivers/pwm/pwm-sun20i.c:341:43: error: invalid use of undefined type 'struct platform_device'
     341 |                 return dev_err_probe(&pdev->dev, ret, "failed to deassert reset\n");
         |                                           ^~
   drivers/pwm/pwm-sun20i.c:343:38: error: invalid use of undefined type 'struct platform_device'
     343 |         sun20i_chip->chip.dev = &pdev->dev;
         |                                      ^~
   drivers/pwm/pwm-sun20i.c:351:43: error: invalid use of undefined type 'struct platform_device'
     351 |                 return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");
         |                                           ^~
>> drivers/pwm/pwm-sun20i.c:354:9: error: implicit declaration of function 'platform_set_drvdata' [-Werror=implicit-function-declaration]
     354 |         platform_set_drvdata(pdev, sun20i_chip);
         |         ^~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: At top level:
   drivers/pwm/pwm-sun20i.c:359:38: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
     359 | static void sun20i_pwm_remove(struct platform_device *pdev)
         |                                      ^~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c: In function 'sun20i_pwm_remove':
>> drivers/pwm/pwm-sun20i.c:361:47: error: implicit declaration of function 'platform_get_drvdata' [-Werror=implicit-function-declaration]
     361 |         struct sun20i_pwm_chip *sun20i_chip = platform_get_drvdata(pdev);
         |                                               ^~~~~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:361:47: warning: initialization of 'struct sun20i_pwm_chip *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   drivers/pwm/pwm-sun20i.c: At top level:
>> drivers/pwm/pwm-sun20i.c:368:15: error: variable 'sun20i_pwm_driver' has initializer but incomplete type
     368 | static struct platform_driver sun20i_pwm_driver = {
         |               ^~~~~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:369:10: error: 'struct platform_driver' has no member named 'driver'
     369 |         .driver = {
         |          ^~~~~~
>> drivers/pwm/pwm-sun20i.c:369:19: error: extra brace group at end of initializer
     369 |         .driver = {
         |                   ^
   drivers/pwm/pwm-sun20i.c:369:19: note: (near initialization for 'sun20i_pwm_driver')
   drivers/pwm/pwm-sun20i.c:369:19: warning: excess elements in struct initializer
   drivers/pwm/pwm-sun20i.c:369:19: note: (near initialization for 'sun20i_pwm_driver')
>> drivers/pwm/pwm-sun20i.c:373:10: error: 'struct platform_driver' has no member named 'probe'
     373 |         .probe = sun20i_pwm_probe,
         |          ^~~~~
   drivers/pwm/pwm-sun20i.c:373:18: warning: excess elements in struct initializer
     373 |         .probe = sun20i_pwm_probe,
         |                  ^~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:373:18: note: (near initialization for 'sun20i_pwm_driver')
>> drivers/pwm/pwm-sun20i.c:374:10: error: 'struct platform_driver' has no member named 'remove_new'
     374 |         .remove_new = sun20i_pwm_remove,
         |          ^~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:374:23: warning: excess elements in struct initializer
     374 |         .remove_new = sun20i_pwm_remove,
         |                       ^~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:374:23: note: (near initialization for 'sun20i_pwm_driver')
   drivers/pwm/pwm-sun20i.c:376:1: warning: data definition has no type or storage class
     376 | module_platform_driver(sun20i_pwm_driver);
         | ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/pwm/pwm-sun20i.c:376:1: error: type defaults to 'int' in declaration of 'module_platform_driver' [-Werror=implicit-int]
   drivers/pwm/pwm-sun20i.c:376:1: warning: parameter names (without types) in function declaration
>> drivers/pwm/pwm-sun20i.c:368:31: error: storage size of 'sun20i_pwm_driver' isn't known
     368 | static struct platform_driver sun20i_pwm_driver = {
         |                               ^~~~~~~~~~~~~~~~~
   drivers/pwm/pwm-sun20i.c:368:31: warning: 'sun20i_pwm_driver' defined but not used [-Wunused-variable]
   cc1: some warnings being treated as errors


vim +288 drivers/pwm/pwm-sun20i.c

   284	
   285	static const struct pwm_ops sun20i_pwm_ops = {
   286		.get_state = sun20i_pwm_get_state,
   287		.apply = sun20i_pwm_apply,
 > 288		.owner = THIS_MODULE,
   289	};
   290	
   291	static const struct of_device_id sun20i_pwm_dt_ids[] = {
   292		{ .compatible = "allwinner,sun20i-d1-pwm" },
   293		{ },
   294	};
   295	MODULE_DEVICE_TABLE(of, sun20i_pwm_dt_ids);
   296	
   297	static int sun20i_pwm_probe(struct platform_device *pdev)
   298	{
   299		struct sun20i_pwm_chip *sun20i_chip;
   300		int ret;
   301	
 > 302		sun20i_chip = devm_kzalloc(&pdev->dev, sizeof(*sun20i_chip), GFP_KERNEL);
   303		if (!sun20i_chip)
   304			return -ENOMEM;
   305	
 > 306		sun20i_chip->base = devm_platform_ioremap_resource(pdev, 0);
   307		if (IS_ERR(sun20i_chip->base))
   308			return PTR_ERR(sun20i_chip->base);
   309	
   310		sun20i_chip->clk_bus = devm_clk_get_enabled(&pdev->dev, "bus");
   311		if (IS_ERR(sun20i_chip->clk_bus))
 > 312			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_bus),
   313					     "failed to get bus clock\n");
   314	
   315		sun20i_chip->clk_hosc = devm_clk_get_enabled(&pdev->dev, "hosc");
   316		if (IS_ERR(sun20i_chip->clk_hosc))
   317			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_hosc),
   318					     "failed to get hosc clock\n");
   319	
   320		sun20i_chip->clk_apb0 = devm_clk_get_enabled(&pdev->dev, "apb0");
   321		if (IS_ERR(sun20i_chip->clk_apb0))
   322			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->clk_apb0),
   323					     "failed to get apb0 clock\n");
   324	
   325		sun20i_chip->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
   326		if (IS_ERR(sun20i_chip->rst))
   327			return dev_err_probe(&pdev->dev, PTR_ERR(sun20i_chip->rst),
   328					     "failed to get bus reset\n");
   329	
   330		ret = of_property_read_u32(pdev->dev.of_node, "allwinner,pwm-channels",
   331					   &sun20i_chip->chip.npwm);
   332		if (ret)
   333			sun20i_chip->chip.npwm = 8;
   334	
   335		if (sun20i_chip->chip.npwm > 16)
   336			sun20i_chip->chip.npwm = 16;
   337	
   338		/* Deassert reset */
   339		ret = reset_control_deassert(sun20i_chip->rst);
   340		if (ret)
   341			return dev_err_probe(&pdev->dev, ret, "failed to deassert reset\n");
   342	
   343		sun20i_chip->chip.dev = &pdev->dev;
   344		sun20i_chip->chip.ops = &sun20i_pwm_ops;
   345	
   346		mutex_init(&sun20i_chip->mutex);
   347	
   348		ret = pwmchip_add(&sun20i_chip->chip);
   349		if (ret < 0) {
   350			reset_control_assert(sun20i_chip->rst);
   351			return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");
   352		}
   353	
 > 354		platform_set_drvdata(pdev, sun20i_chip);
   355	
   356		return 0;
   357	}
   358	
   359	static void sun20i_pwm_remove(struct platform_device *pdev)
   360	{
 > 361		struct sun20i_pwm_chip *sun20i_chip = platform_get_drvdata(pdev);
   362	
   363		pwmchip_remove(&sun20i_chip->chip);
   364	
   365		reset_control_assert(sun20i_chip->rst);
   366	}
   367	
 > 368	static struct platform_driver sun20i_pwm_driver = {
 > 369		.driver = {
   370			.name = "sun20i-pwm",
   371			.of_match_table = sun20i_pwm_dt_ids,
   372		},
 > 373		.probe = sun20i_pwm_probe,
 > 374		.remove_new = sun20i_pwm_remove,
   375	};
 > 376	module_platform_driver(sun20i_pwm_driver);
   377	

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2024-01-25 23:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25  7:19 [PATCH v7 0/3] Add support for Allwinner PWM on D1/T113s/R329 SoCs Aleksandr Shubin
2024-01-25  7:19 ` Aleksandr Shubin
2024-01-25  7:19 ` Aleksandr Shubin
2024-01-25  7:19 ` [PATCH v7 1/3] dt-bindings: pwm: Add binding for Allwinner D1/T113-S3/R329 PWM controller Aleksandr Shubin
2024-01-25  7:19   ` Aleksandr Shubin
2024-01-25  7:19   ` Aleksandr Shubin
2024-01-25  7:19 ` [PATCH v7 2/3] pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support Aleksandr Shubin
2024-01-25  7:19   ` Aleksandr Shubin
2024-01-25  7:19   ` Aleksandr Shubin
2024-01-25 15:11   ` kernel test robot
2024-01-25 15:11     ` kernel test robot
2024-01-25 15:11     ` kernel test robot
2024-01-25 23:13   ` kernel test robot [this message]
2024-01-25 23:13     ` kernel test robot
2024-01-25 23:13     ` kernel test robot
2024-01-26  0:38   ` kernel test robot
2024-01-26  0:38     ` kernel test robot
2024-01-26  0:38     ` kernel test robot
2024-01-25  7:19 ` [PATCH v7 3/3] riscv: dts: allwinner: d1: Add pwm node Aleksandr Shubin
2024-01-25  7:19   ` Aleksandr Shubin
2024-01-25  7:19   ` Aleksandr Shubin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202401260632.l2X5DTxa-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bigunclemax@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=contact@jookia.org \
    --cc=cristian.ciocaltea@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fusibrandon13@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mkl@pengutronix.de \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=privatesub2@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.