All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Rob Herring <robh@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [robh:for-next 6/7] drivers/tty/serial/esp32_uart.c:680:31: error: dereferencing pointer to incomplete type 'struct platform_device'
Date: Thu, 7 Dec 2023 23:40:23 +0800	[thread overview]
Message-ID: <202312072332.KHd7pWmL-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
head:   6c26cfb1561efbf12fe3cf700ddc2e956866af45
commit: f793fea7761d32ed64767311c82f39f0798fe6d6 [6/7] of: Stop circularly including of_device.h and of_platform.h
config: i386-buildonly-randconfig-002-20231207 (https://download.01.org/0day-ci/archive/20231207/202312072332.KHd7pWmL-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231207/202312072332.KHd7pWmL-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/202312072332.KHd7pWmL-lkp@intel.com/

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

   drivers/auxdisplay/img-ascii-lcd.c: In function 'img_ascii_lcd_probe':
   drivers/auxdisplay/img-ascii-lcd.c:234:10: error: implicit declaration of function 'of_match_device'; did you mean 'of_match_node'? [-Werror=implicit-function-declaration]
     match = of_match_device(img_ascii_lcd_matches, dev);
             ^~~~~~~~~~~~~~~
             of_match_node
>> drivers/auxdisplay/img-ascii-lcd.c:234:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     match = of_match_device(img_ascii_lcd_matches, dev);
           ^
   cc1: some warnings being treated as errors
--
   drivers/tty/serial/esp32_uart.c:678:36: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
    static int esp32_uart_probe(struct platform_device *pdev)
                                       ^~~~~~~~~~~~~~~
   drivers/tty/serial/esp32_uart.c: In function 'esp32_uart_probe':
>> drivers/tty/serial/esp32_uart.c:680:31: error: dereferencing pointer to incomplete type 'struct platform_device'
     struct device_node *np = pdev->dev.of_node;
                                  ^~
   drivers/tty/serial/esp32_uart.c:709:8: error: implicit declaration of function 'platform_get_resource'; did you mean 'platform_notify_remove'? [-Werror=implicit-function-declaration]
     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
           ^~~~~~~~~~~~~~~~~~~~~
           platform_notify_remove
>> drivers/tty/serial/esp32_uart.c:709:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
         ^
   drivers/tty/serial/esp32_uart.c:726:14: error: implicit declaration of function 'platform_get_irq'; did you mean 'platform_notify'? [-Werror=implicit-function-declaration]
     port->irq = platform_get_irq(pdev, 0);
                 ^~~~~~~~~~~~~~~~
                 platform_notify
   drivers/tty/serial/esp32_uart.c:735:2: error: implicit declaration of function 'platform_set_drvdata'; did you mean 'dev_set_drvdata'? [-Werror=implicit-function-declaration]
     platform_set_drvdata(pdev, port);
     ^~~~~~~~~~~~~~~~~~~~
     dev_set_drvdata
   drivers/tty/serial/esp32_uart.c: At top level:
   drivers/tty/serial/esp32_uart.c:740:37: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
    static int esp32_uart_remove(struct platform_device *pdev)
                                        ^~~~~~~~~~~~~~~
   drivers/tty/serial/esp32_uart.c: In function 'esp32_uart_remove':
   drivers/tty/serial/esp32_uart.c:742:27: error: implicit declaration of function 'platform_get_drvdata'; did you mean 'dev_get_drvdata'? [-Werror=implicit-function-declaration]
     struct uart_port *port = platform_get_drvdata(pdev);
                              ^~~~~~~~~~~~~~~~~~~~
                              dev_get_drvdata
>> drivers/tty/serial/esp32_uart.c:742:27: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   drivers/tty/serial/esp32_uart.c: At top level:
   drivers/tty/serial/esp32_uart.c:750:15: error: variable 'esp32_uart_driver' has initializer but incomplete type
    static struct platform_driver esp32_uart_driver = {
                  ^~~~~~~~~~~~~~~
   drivers/tty/serial/esp32_uart.c:751:3: error: 'struct platform_driver' has no member named 'probe'
     .probe  = esp32_uart_probe,
      ^~~~~
   drivers/tty/serial/esp32_uart.c:751:12: warning: excess elements in struct initializer
     .probe  = esp32_uart_probe,
               ^~~~~~~~~~~~~~~~
   drivers/tty/serial/esp32_uart.c:751:12: note: (near initialization for 'esp32_uart_driver')
   drivers/tty/serial/esp32_uart.c:752:3: error: 'struct platform_driver' has no member named 'remove'
     .remove  = esp32_uart_remove,
      ^~~~~~
   drivers/tty/serial/esp32_uart.c:752:13: warning: excess elements in struct initializer
     .remove  = esp32_uart_remove,
                ^~~~~~~~~~~~~~~~~
   drivers/tty/serial/esp32_uart.c:752:13: note: (near initialization for 'esp32_uart_driver')
   drivers/tty/serial/esp32_uart.c:753:3: error: 'struct platform_driver' has no member named 'driver'
     .driver  = {
      ^~~~~~
   drivers/tty/serial/esp32_uart.c:753:13: error: extra brace group at end of initializer
     .driver  = {
                ^
   drivers/tty/serial/esp32_uart.c:753:13: note: (near initialization for 'esp32_uart_driver')
   drivers/tty/serial/esp32_uart.c:753:13: warning: excess elements in struct initializer
   drivers/tty/serial/esp32_uart.c:753:13: note: (near initialization for 'esp32_uart_driver')
   drivers/tty/serial/esp32_uart.c: In function 'esp32_uart_init':
   drivers/tty/serial/esp32_uart.c:767:8: error: implicit declaration of function 'platform_driver_register'; did you mean 'driver_register'? [-Werror=implicit-function-declaration]
     ret = platform_driver_register(&esp32_uart_driver);
           ^~~~~~~~~~~~~~~~~~~~~~~~
           driver_register
   drivers/tty/serial/esp32_uart.c: In function 'esp32_uart_exit':
   drivers/tty/serial/esp32_uart.c:776:2: error: implicit declaration of function 'platform_driver_unregister'; did you mean 'driver_unregister'? [-Werror=implicit-function-declaration]
     platform_driver_unregister(&esp32_uart_driver);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
     driver_unregister
   drivers/tty/serial/esp32_uart.c: At top level:
   drivers/tty/serial/esp32_uart.c:750:31: error: storage size of 'esp32_uart_driver' isn't known
    static struct platform_driver esp32_uart_driver = {
                                  ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +680 drivers/tty/serial/esp32_uart.c

8cc89a229aac81 Max Filippov 2023-10-10  677  
8cc89a229aac81 Max Filippov 2023-10-10  678  static int esp32_uart_probe(struct platform_device *pdev)
8cc89a229aac81 Max Filippov 2023-10-10  679  {
8cc89a229aac81 Max Filippov 2023-10-10 @680  	struct device_node *np = pdev->dev.of_node;
8cc89a229aac81 Max Filippov 2023-10-10  681  	static const struct of_device_id *match;
8cc89a229aac81 Max Filippov 2023-10-10  682  	struct uart_port *port;
8cc89a229aac81 Max Filippov 2023-10-10  683  	struct esp32_port *sport;
8cc89a229aac81 Max Filippov 2023-10-10  684  	struct resource *res;
8cc89a229aac81 Max Filippov 2023-10-10  685  	int ret;
8cc89a229aac81 Max Filippov 2023-10-10  686  
8cc89a229aac81 Max Filippov 2023-10-10  687  	match = of_match_device(esp32_uart_dt_ids, &pdev->dev);
8cc89a229aac81 Max Filippov 2023-10-10  688  	if (!match)
8cc89a229aac81 Max Filippov 2023-10-10  689  		return -ENODEV;
8cc89a229aac81 Max Filippov 2023-10-10  690  
8cc89a229aac81 Max Filippov 2023-10-10  691  	sport = devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL);
8cc89a229aac81 Max Filippov 2023-10-10  692  	if (!sport)
8cc89a229aac81 Max Filippov 2023-10-10  693  		return -ENOMEM;
8cc89a229aac81 Max Filippov 2023-10-10  694  
8cc89a229aac81 Max Filippov 2023-10-10  695  	port = &sport->port;
8cc89a229aac81 Max Filippov 2023-10-10  696  
8cc89a229aac81 Max Filippov 2023-10-10  697  	ret = of_alias_get_id(np, "serial");
8cc89a229aac81 Max Filippov 2023-10-10  698  	if (ret < 0) {
8cc89a229aac81 Max Filippov 2023-10-10  699  		dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret);
8cc89a229aac81 Max Filippov 2023-10-10  700  		return ret;
8cc89a229aac81 Max Filippov 2023-10-10  701  	}
8cc89a229aac81 Max Filippov 2023-10-10  702  	if (ret >= UART_NR) {
8cc89a229aac81 Max Filippov 2023-10-10  703  		dev_err(&pdev->dev, "driver limited to %d serial ports\n", UART_NR);
8cc89a229aac81 Max Filippov 2023-10-10  704  		return -ENOMEM;
8cc89a229aac81 Max Filippov 2023-10-10  705  	}
8cc89a229aac81 Max Filippov 2023-10-10  706  
8cc89a229aac81 Max Filippov 2023-10-10  707  	port->line = ret;
8cc89a229aac81 Max Filippov 2023-10-10  708  
8cc89a229aac81 Max Filippov 2023-10-10 @709  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
8cc89a229aac81 Max Filippov 2023-10-10  710  	if (!res)
8cc89a229aac81 Max Filippov 2023-10-10  711  		return -ENODEV;
8cc89a229aac81 Max Filippov 2023-10-10  712  
8cc89a229aac81 Max Filippov 2023-10-10  713  	port->mapbase = res->start;
8cc89a229aac81 Max Filippov 2023-10-10  714  	port->membase = devm_ioremap_resource(&pdev->dev, res);
8cc89a229aac81 Max Filippov 2023-10-10  715  	if (IS_ERR(port->membase))
8cc89a229aac81 Max Filippov 2023-10-10  716  		return PTR_ERR(port->membase);
8cc89a229aac81 Max Filippov 2023-10-10  717  
8cc89a229aac81 Max Filippov 2023-10-10  718  	sport->clk = devm_clk_get(&pdev->dev, NULL);
8cc89a229aac81 Max Filippov 2023-10-10  719  	if (IS_ERR(sport->clk))
8cc89a229aac81 Max Filippov 2023-10-10  720  		return PTR_ERR(sport->clk);
8cc89a229aac81 Max Filippov 2023-10-10  721  
8cc89a229aac81 Max Filippov 2023-10-10  722  	port->uartclk = clk_get_rate(sport->clk);
8cc89a229aac81 Max Filippov 2023-10-10  723  	port->dev = &pdev->dev;
8cc89a229aac81 Max Filippov 2023-10-10  724  	port->type = PORT_GENERIC;
8cc89a229aac81 Max Filippov 2023-10-10  725  	port->iotype = UPIO_MEM;
8cc89a229aac81 Max Filippov 2023-10-10  726  	port->irq = platform_get_irq(pdev, 0);
8cc89a229aac81 Max Filippov 2023-10-10  727  	port->ops = &esp32_uart_pops;
8cc89a229aac81 Max Filippov 2023-10-10  728  	port->flags = UPF_BOOT_AUTOCONF;
8cc89a229aac81 Max Filippov 2023-10-10  729  	port->has_sysrq = 1;
8cc89a229aac81 Max Filippov 2023-10-10  730  	port->fifosize = ESP32_UART_TX_FIFO_SIZE;
8cc89a229aac81 Max Filippov 2023-10-10  731  	port->private_data = (void *)match->data;
8cc89a229aac81 Max Filippov 2023-10-10  732  
8cc89a229aac81 Max Filippov 2023-10-10  733  	esp32_uart_ports[port->line] = sport;
8cc89a229aac81 Max Filippov 2023-10-10  734  
8cc89a229aac81 Max Filippov 2023-10-10  735  	platform_set_drvdata(pdev, port);
8cc89a229aac81 Max Filippov 2023-10-10  736  
8cc89a229aac81 Max Filippov 2023-10-10  737  	return uart_add_one_port(&esp32_uart_reg, port);
8cc89a229aac81 Max Filippov 2023-10-10  738  }
8cc89a229aac81 Max Filippov 2023-10-10  739  
8cc89a229aac81 Max Filippov 2023-10-10  740  static int esp32_uart_remove(struct platform_device *pdev)
8cc89a229aac81 Max Filippov 2023-10-10  741  {
8cc89a229aac81 Max Filippov 2023-10-10 @742  	struct uart_port *port = platform_get_drvdata(pdev);
8cc89a229aac81 Max Filippov 2023-10-10  743  
8cc89a229aac81 Max Filippov 2023-10-10  744  	uart_remove_one_port(&esp32_uart_reg, port);
8cc89a229aac81 Max Filippov 2023-10-10  745  
8cc89a229aac81 Max Filippov 2023-10-10  746  	return 0;
8cc89a229aac81 Max Filippov 2023-10-10  747  }
8cc89a229aac81 Max Filippov 2023-10-10  748  

:::::: The code at line 680 was first introduced by commit
:::::: 8cc89a229aac8183ffd4c385de0b6b9543175eff drivers/tty/serial: add driver for the ESP32 UART

:::::: TO: Max Filippov <jcmvbkbc@gmail.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

                 reply	other threads:[~2023-12-07 15:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202312072332.KHd7pWmL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@kernel.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.