From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8383332481756316476==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [RFC][PATCH 3/3] usb: dwc3: Registering a role switch in the DRD code. Date: Mon, 14 Oct 2019 06:01:28 +0800 Message-ID: <201910140549.NOVlVC5f%lkp@intel.com> In-Reply-To: <20191002231617.3670-4-john.stultz@linaro.org> List-Id: --===============8383332481756316476== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi John, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on usb/usb-testing] [cannot apply to v5.4-rc2 next-20191011] [if your patch is applied to the wrong git tree, please drop us a note to h= elp 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/37406= 982] url: https://github.com/0day-ci/linux/commits/John-Stultz/dwc3-role-swit= ch-handling-for-HiKey960/20191003-072715 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-= testing reproduce: # apt-get install sparse # sparse version: v0.6.1-rc1-43-g0ccb3b4-dirty make ARCH=3Dx86_64 allmodconfig make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) >> drivers/usb/dwc3/drd.c:543:65: sparse: sparse: Using plain integer as NU= LL pointer vim +543 drivers/usb/dwc3/drd.c 533 = 534 int dwc3_drd_init(struct dwc3 *dwc) 535 { 536 int ret, irq; 537 = 538 dwc->edev =3D dwc3_get_extcon(dwc); 539 if (IS_ERR(dwc->edev)) 540 return PTR_ERR(dwc->edev); 541 = 542 if (device_property_read_bool(dwc->dev, "usb-role-switch")) { > 543 struct usb_role_switch_desc dwc3_role_switch =3D {0}; 544 u32 mode; 545 = 546 if (device_property_read_bool(dwc->dev, 547 "role-switch-default-host")) { 548 dwc->role_switch_default_mode =3D USB_DR_MODE_HOST; 549 mode =3D DWC3_GCTL_PRTCAP_HOST; 550 } else { 551 dwc->role_switch_default_mode =3D USB_DR_MODE_PERIPHERAL; 552 mode =3D DWC3_GCTL_PRTCAP_DEVICE; 553 } 554 dwc3_role_switch.fwnode =3D dev_fwnode(dwc->dev); 555 dwc3_role_switch.set =3D dwc3_usb_role_switch_set; 556 dwc3_role_switch.get =3D dwc3_usb_role_switch_get; 557 dwc->role_sw =3D usb_role_switch_register(dwc->dev, 558 &dwc3_role_switch); 559 if (IS_ERR(dwc->role_sw)) 560 return PTR_ERR(dwc->role_sw); 561 = 562 dwc3_set_mode(dwc, mode); 563 } else if (dwc->edev) { 564 dwc->edev_nb.notifier_call =3D dwc3_drd_notifier; 565 ret =3D extcon_register_notifier(dwc->edev, EXTCON_USB_HOST, 566 &dwc->edev_nb); 567 if (ret < 0) { 568 dev_err(dwc->dev, "couldn't register cable notifier\n"); 569 return ret; 570 } 571 = 572 dwc3_drd_update(dwc); 573 } else { 574 dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_OTG); 575 dwc->current_dr_role =3D DWC3_GCTL_PRTCAP_OTG; 576 = 577 /* use OTG block to get ID event */ 578 irq =3D dwc3_otg_get_irq(dwc); 579 if (irq < 0) 580 return irq; 581 = 582 dwc->otg_irq =3D irq; 583 = 584 /* disable all OTG IRQs */ 585 dwc3_otg_disable_events(dwc, DWC3_OTG_ALL_EVENTS); 586 /* clear all events */ 587 dwc3_otg_clear_events(dwc); 588 = 589 ret =3D request_threaded_irq(dwc->otg_irq, dwc3_otg_irq, 590 dwc3_otg_thread_irq, 591 IRQF_SHARED, "dwc3-otg", dwc); 592 if (ret) { 593 dev_err(dwc->dev, "failed to request irq #%d --> %d\n", 594 dwc->otg_irq, ret); 595 ret =3D -ENODEV; 596 return ret; 597 } 598 = 599 dwc3_otg_init(dwc); 600 dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG); 601 } 602 = 603 return 0; 604 } 605 = --- 0-DAY kernel test infrastructure Open Source Technology Cent= er https://lists.01.org/pipermail/kbuild-all Intel Corporati= on --===============8383332481756316476==--