Re: [PATCH 83/97] usb: xhci-plat: Convert to platform remove callback returning void
From: kernel test robot <hidden>
Date: 2023-05-18 10:37:35
Also in:
llvm, oe-kbuild-all
Hi Uwe, kernel test robot noticed the following build errors: [auto build test ERROR on ac9a78681b921877518763ba0e89202254349d1b] url: https://github.com/intel-lab-lkp/linux/commits/Uwe-Kleine-K-nig/usb-c67x00-drv-Convert-to-platform-remove-callback-returning-void/20230518-070939 base: ac9a78681b921877518763ba0e89202254349d1b patch link: https://lore.kernel.org/r/20230517230239.187727-84-u.kleine-koenig%40pengutronix.de patch subject: [PATCH 83/97] usb: xhci-plat: Convert to platform remove callback returning void config: arm-buildonly-randconfig-r004-20230517 compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b0fb98227c90adf2536c9ad644a74d5e92961111) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/intel-lab-lkp/linux/commit/a15d372314b8d59dad452c251a3a72b9fc2d7cf8 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Uwe-Kleine-K-nig/usb-c67x00-drv-Convert-to-platform-remove-callback-returning-void/20230518-070939 git checkout a15d372314b8d59dad452c251a3a72b9fc2d7cf8 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/usb/host/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot [off-list ref] | Closes: https://lore.kernel.org/oe-kbuild-all/202305181842.waSxU819-lkp@intel.com/ (local) All errors (new ones prefixed by >>):
quoted
drivers/usb/host/xhci-plat.c:402:6: error: conflicting types for 'xhci_plat_remove'
void xhci_plat_remove(struct platform_device *dev)
^
drivers/usb/host/xhci-plat.h:28:5: note: previous declaration is here
int xhci_plat_remove(struct platform_device *dev);
^quoted
drivers/usb/host/xhci-plat.c:531:16: error: incompatible function pointer types initializing 'void (*)(struct platform_device *)' with an expression of type 'int (struct platform_device *)' [-Wincompatible-function-pointer-types]
.remove_new = xhci_plat_remove,
^~~~~~~~~~~~~~~~
2 errors generated.
vim +/xhci_plat_remove +402 drivers/usb/host/xhci-plat.c
401
> 402 void xhci_plat_remove(struct platform_device *dev)
403 {
404 struct usb_hcd *hcd = platform_get_drvdata(dev);
405 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
406 struct clk *clk = xhci->clk;
407 struct clk *reg_clk = xhci->reg_clk;
408 struct usb_hcd *shared_hcd = xhci->shared_hcd;
409
410 pm_runtime_get_sync(&dev->dev);
411 xhci->xhc_state |= XHCI_STATE_REMOVING;
412
413 if (shared_hcd) {
414 usb_remove_hcd(shared_hcd);
415 xhci->shared_hcd = NULL;
416 }
417
418 usb_phy_shutdown(hcd->usb_phy);
419
420 usb_remove_hcd(hcd);
421
422 if (shared_hcd)
423 usb_put_hcd(shared_hcd);
424
425 clk_disable_unprepare(clk);
426 clk_disable_unprepare(reg_clk);
427 reset_control_assert(xhci->reset);
428 usb_put_hcd(hcd);
429
430 pm_runtime_disable(&dev->dev);
431 pm_runtime_put_noidle(&dev->dev);
432 pm_runtime_set_suspended(&dev->dev);
433 }
434 EXPORT_SYMBOL_GPL(xhci_plat_remove);
435
436 static int __maybe_unused xhci_plat_suspend(struct device *dev)
437 {
438 struct usb_hcd *hcd = dev_get_drvdata(dev);
439 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
440 int ret;
441
442 if (pm_runtime_suspended(dev))
443 pm_runtime_resume(dev);
444
445 ret = xhci_priv_suspend_quirk(hcd);
446 if (ret)
447 return ret;
448 /*
449 * xhci_suspend() needs `do_wakeup` to know whether host is allowed
450 * to do wakeup during suspend.
451 */
452 ret = xhci_suspend(xhci, device_may_wakeup(dev));
453 if (ret)
454 return ret;
455
456 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) {
457 clk_disable_unprepare(xhci->clk);
458 clk_disable_unprepare(xhci->reg_clk);
459 }
460
461 return 0;
462 }
463
464 static int __maybe_unused xhci_plat_resume(struct device *dev)
465 {
466 struct usb_hcd *hcd = dev_get_drvdata(dev);
467 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
468 int ret;
469
470 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) {
471 clk_prepare_enable(xhci->clk);
472 clk_prepare_enable(xhci->reg_clk);
473 }
474
475 ret = xhci_priv_resume_quirk(hcd);
476 if (ret)
477 return ret;
478
479 ret = xhci_resume(xhci, 0);
480 if (ret)
481 return ret;
482
483 pm_runtime_disable(dev);
484 pm_runtime_set_active(dev);
485 pm_runtime_enable(dev);
486
487 return 0;
488 }
489
490 static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev)
491 {
492 struct usb_hcd *hcd = dev_get_drvdata(dev);
493 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
494 int ret;
495
496 ret = xhci_priv_suspend_quirk(hcd);
497 if (ret)
498 return ret;
499
500 return xhci_suspend(xhci, true);
501 }
502
503 static int __maybe_unused xhci_plat_runtime_resume(struct device *dev)
504 {
505 struct usb_hcd *hcd = dev_get_drvdata(dev);
506 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
507
508 return xhci_resume(xhci, 0);
509 }
510
511 const struct dev_pm_ops xhci_plat_pm_ops = {
512 SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)
513
514 SET_RUNTIME_PM_OPS(xhci_plat_runtime_suspend,
515 xhci_plat_runtime_resume,
516 NULL)
517 };
518 EXPORT_SYMBOL_GPL(xhci_plat_pm_ops);
519
520 #ifdef CONFIG_ACPI
521 static const struct acpi_device_id usb_xhci_acpi_match[] = {
522 /* XHCI-compliant USB Controller */
523 { "PNP0D10", },
524 { }
525 };
526 MODULE_DEVICE_TABLE(acpi, usb_xhci_acpi_match);
527 #endif
528
529 static struct platform_driver usb_generic_xhci_driver = {
530 .probe = xhci_generic_plat_probe,
> 531 .remove_new = xhci_plat_remove,
532 .shutdown = usb_hcd_platform_shutdown,
533 .driver = {
534 .name = "xhci-hcd",
535 .pm = &xhci_plat_pm_ops,
536 .of_match_table = of_match_ptr(usb_xhci_of_match),
537 .acpi_match_table = ACPI_PTR(usb_xhci_acpi_match),
538 },
539 };
540 MODULE_ALIAS("platform:xhci-hcd");
541
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki