[PATCH v2 1/4] usb: ehci-vf: remove the code path for a build without DM_USB
Mehmet Fide <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <[email protected]> |
From: Mehmet Fide <[email protected]> USB_EHCI_HCD selects DM_USB, so the !CONFIG_IS_ENABLED(DM_USB) branch of this driver can never be selected. It also cannot compile: ehci_hcd_init() calls ehci_vf_common_init() with one argument while the function takes two, so the branch has been dead since the controller was added as a second parameter. Remove it, together with the board_usb_phy_mode() hook that no board implements and nothing else calls. Signed-off-by: Mehmet Fide <[email protected]> --- drivers/usb/host/ehci-vf.c | 49 -------------------------------------- 1 file changed, 49 deletions(-) diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c index 32fe05920d0..5d27318de62 100644 --- a/drivers/usb/host/ehci-vf.c +++ b/drivers/usb/host/ehci-vf.c @@ -128,11 +128,6 @@ static void usb_oc_config(int index) setbits_le32(ctrl, UCTRL_OVER_CUR_DIS); } -int __weak board_usb_phy_mode(int port) -{ - return 0; -} - int __weak board_ehci_hcd_init(int port) { return 0; @@ -155,49 +150,6 @@ int ehci_vf_common_init(struct usb_ehci *ehci, int index) return 0; } -#if !CONFIG_IS_ENABLED(DM_USB) -int ehci_hcd_init(int index, enum usb_init_type init, - struct ehci_hccr **hccr, struct ehci_hcor **hcor) -{ - struct usb_ehci *ehci; - enum usb_init_type type; - int ret; - - if (index >= ARRAY_SIZE(nc_reg_bases)) - return -EINVAL; - - ehci = (struct usb_ehci *)nc_reg_bases[index]; - - ret = ehci_vf_common_init(index); - if (ret) - return ret; - - *hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength); - *hcor = (struct ehci_hcor *)((uint32_t)*hccr + - HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); - - type = board_usb_phy_mode(index); - if (type != init) - return -ENODEV; - - if (init == USB_INIT_DEVICE) { - setbits_le32(&ehci->usbmode, CM_DEVICE); - writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc); - setbits_le32(&ehci->portsc, USB_EN); - } else if (init == USB_INIT_HOST) { - setbits_le32(&ehci->usbmode, CM_HOST); - writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc); - setbits_le32(&ehci->portsc, USB_EN); - } - - return 0; -} - -int ehci_hcd_stop(int index) -{ - return 0; -} -#else /* Possible port types (dual role mode) */ enum dr_mode { DR_MODE_NONE = 0, @@ -372,4 +324,3 @@ U_BOOT_DRIVER(ehci_vf) = { .priv_auto = sizeof(struct ehci_vf_priv_data), .flags = DM_FLAG_ALLOC_PRIV_DMA, }; -#endif -- 2.54.0