[PATCH 4/8] usb: Remove non-DM code in ehci-fsl and xhci
Tom Rini
trini at konsulko.com
Mon Jun 13 02:02:01 CEST 2022
The DM_USB migration deadline has passed and this is not used in SPL.
Remove this now unused code.
Signed-off-by: Tom Rini <trini at konsulko.com>
---
drivers/usb/host/ehci-fsl.c | 4 --
drivers/usb/host/xhci.c | 110 ------------------------------------
2 files changed, 114 deletions(-)
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 82da339fd505..0569dd54fff9 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -25,10 +25,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
struct ehci_fsl_priv {
struct ehci_ctrl ehci;
fdt_addr_t hcd_base;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index ad73ba12e2be..dbeb88afe370 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -37,10 +37,6 @@
#include <linux/errno.h>
#include <linux/iopoll.h>
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
static struct descriptor {
struct usb_hub_descriptor hub;
struct usb_device_descriptor device;
@@ -115,13 +111,8 @@ static struct descriptor {
},
};
-#if !CONFIG_IS_ENABLED(DM_USB)
-static struct xhci_ctrl xhcic[CONFIG_USB_MAX_CONTROLLER_COUNT];
-#endif
-
struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev)
{
-#if CONFIG_IS_ENABLED(DM_USB)
struct udevice *dev;
/* Find the USB controller */
@@ -130,9 +121,6 @@ struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev)
dev = dev->parent)
;
return dev_get_priv(dev);
-#else
- return udev->controller;
-#endif
}
/**
@@ -752,13 +740,6 @@ static int _xhci_alloc_device(struct usb_device *udev)
return 0;
}
-#if !CONFIG_IS_ENABLED(DM_USB)
-int usb_alloc_device(struct usb_device *udev)
-{
- return _xhci_alloc_device(udev);
-}
-#endif
-
/*
* Full speed devices may have a max packet size greater than 8 bytes, but the
* USB core doesn't know that until it reads the first 8 bytes of the
@@ -1267,95 +1248,6 @@ static int xhci_lowlevel_stop(struct xhci_ctrl *ctrl)
return 0;
}
-#if !CONFIG_IS_ENABLED(DM_USB)
-int submit_control_msg(struct usb_device *udev, unsigned long pipe,
- void *buffer, int length, struct devrequest *setup)
-{
- struct usb_device *hop = udev;
-
- if (hop->parent)
- while (hop->parent->parent)
- hop = hop->parent;
-
- return _xhci_submit_control_msg(udev, pipe, buffer, length, setup,
- hop->portnr);
-}
-
-int submit_bulk_msg(struct usb_device *udev, unsigned long pipe, void *buffer,
- int length)
-{
- return _xhci_submit_bulk_msg(udev, pipe, buffer, length);
-}
-
-int submit_int_msg(struct usb_device *udev, unsigned long pipe, void *buffer,
- int length, int interval, bool nonblock)
-{
- return _xhci_submit_int_msg(udev, pipe, buffer, length, interval,
- nonblock);
-}
-
-/**
- * Intialises the XHCI host controller
- * and allocates the necessary data structures
- *
- * @param index index to the host controller data structure
- * Return: pointer to the intialised controller
- */
-int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
-{
- struct xhci_hccr *hccr;
- struct xhci_hcor *hcor;
- struct xhci_ctrl *ctrl;
- int ret;
-
- *controller = NULL;
-
- if (xhci_hcd_init(index, &hccr, (struct xhci_hcor **)&hcor) != 0)
- return -ENODEV;
-
- if (xhci_reset(hcor) != 0)
- return -ENODEV;
-
- ctrl = &xhcic[index];
-
- ctrl->hccr = hccr;
- ctrl->hcor = hcor;
-
- ret = xhci_lowlevel_init(ctrl);
-
- if (ret) {
- ctrl->hccr = NULL;
- ctrl->hcor = NULL;
- } else {
- *controller = &xhcic[index];
- }
-
- return ret;
-}
-
-/**
- * Stops the XHCI host controller
- * and cleans up all the related data structures
- *
- * @param index index to the host controller data structure
- * Return: none
- */
-int usb_lowlevel_stop(int index)
-{
- struct xhci_ctrl *ctrl = (xhcic + index);
-
- if (ctrl->hcor) {
- xhci_lowlevel_stop(ctrl);
- xhci_hcd_stop(index);
- xhci_cleanup(ctrl);
- }
-
- return 0;
-}
-#endif /* CONFIG_IS_ENABLED(DM_USB) */
-
-#if CONFIG_IS_ENABLED(DM_USB)
-
static int xhci_submit_control_msg(struct udevice *dev, struct usb_device *udev,
unsigned long pipe, void *buffer, int length,
struct devrequest *setup)
@@ -1546,5 +1438,3 @@ struct dm_usb_ops xhci_usb_ops = {
.update_hub_device = xhci_update_hub_device,
.get_max_xfer_size = xhci_get_max_xfer_size,
};
-
-#endif
--
2.25.1
More information about the U-Boot
mailing list