Page MenuHomeFreeBSD

D33827.id.diff
No OneTemporary

D33827.id.diff

diff --git a/sys/dev/usb/controller/generic_ehci_fdt.c b/sys/dev/usb/controller/generic_ehci_fdt.c
--- a/sys/dev/usb/controller/generic_ehci_fdt.c
+++ b/sys/dev/usb/controller/generic_ehci_fdt.c
@@ -56,16 +56,13 @@
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#ifdef EXT_RESOURCES
#include <dev/extres/clk/clk.h>
#include <dev/extres/hwreset/hwreset.h>
#include <dev/extres/phy/phy.h>
#include <dev/extres/phy/phy_usb.h>
-#endif
#include "generic_ehci.h"
-#ifdef EXT_RESOURCES
struct clk_list {
TAILQ_ENTRY(clk_list) next;
clk_t clk;
@@ -80,16 +77,13 @@
TAILQ_ENTRY(phy_list) next;
phy_t phy;
};
-#endif
struct generic_ehci_fdt_softc {
ehci_softc_t ehci_sc;
-#ifdef EXT_RESOURCES
TAILQ_HEAD(, clk_list) clk_list;
TAILQ_HEAD(, hwrst_list) rst_list;
TAILQ_HEAD(, phy_list) phy_list;
-#endif
};
static device_probe_t generic_ehci_fdt_probe;
@@ -114,7 +108,6 @@
generic_ehci_fdt_attach(device_t dev)
{
int err;
-#ifdef EXT_RESOURCES
struct generic_ehci_fdt_softc *sc;
struct clk_list *clkp;
clk_t clk;
@@ -170,7 +163,6 @@
phyp->phy = phy;
TAILQ_INSERT_TAIL(&sc->phy_list, phyp, next);
}
-#endif
err = generic_ehci_attach(dev);
if (err != 0)
@@ -186,19 +178,16 @@
static int
generic_ehci_fdt_detach(device_t dev)
{
-#ifdef EXT_RESOURCES
struct generic_ehci_fdt_softc *sc;
struct clk_list *clk, *clk_tmp;
struct hwrst_list *rst, *rst_tmp;
struct phy_list *phy, *phy_tmp;
-#endif
int err;
err = generic_ehci_detach(dev);
if (err != 0)
return (err);
-#ifdef EXT_RESOURCES
sc = device_get_softc(dev);
/* Disable clock */
@@ -232,7 +221,6 @@
TAILQ_REMOVE(&sc->phy_list, phy, next);
free(phy, M_DEVBUF);
}
-#endif
return (0);
}
diff --git a/sys/dev/usb/controller/generic_ohci.c b/sys/dev/usb/controller/generic_ohci.c
--- a/sys/dev/usb/controller/generic_ohci.c
+++ b/sys/dev/usb/controller/generic_ohci.c
@@ -56,16 +56,13 @@
#include <dev/usb/controller/ohci.h>
#include <dev/usb/controller/ohcireg.h>
-#ifdef EXT_RESOURCES
#include <dev/extres/clk/clk.h>
#include <dev/extres/hwreset/hwreset.h>
#include <dev/extres/phy/phy.h>
#include <dev/extres/phy/phy_usb.h>
-#endif
#include "generic_usb_if.h"
-#ifdef EXT_RESOURCES
struct clk_list {
TAILQ_ENTRY(clk_list) next;
clk_t clk;
@@ -78,16 +75,13 @@
TAILQ_ENTRY(hwrst_list) next;
hwreset_t rst;
};
-#endif
struct generic_ohci_softc {
ohci_softc_t ohci_sc;
-#ifdef EXT_RESOURCES
TAILQ_HEAD(, clk_list) clk_list;
TAILQ_HEAD(, phy_list) phy_list;
TAILQ_HEAD(, hwrst_list) rst_list;
-#endif
};
static int generic_ohci_detach(device_t);
@@ -112,7 +106,6 @@
{
struct generic_ohci_softc *sc = device_get_softc(dev);
int err, rid;
-#ifdef EXT_RESOURCES
int off;
struct clk_list *clkp;
struct phy_list *phyp;
@@ -120,7 +113,6 @@
clk_t clk;
phy_t phy;
hwreset_t rst;
-#endif
sc->ohci_sc.sc_bus.parent = dev;
sc->ohci_sc.sc_bus.devices = sc->ohci_sc.sc_devices;
@@ -170,7 +162,6 @@
goto error;
}
-#ifdef EXT_RESOURCES
TAILQ_INIT(&sc->clk_list);
/* Enable clock */
for (off = 0; clk_get_by_ofw_index(dev, 0, off, &clk) == 0; off++) {
@@ -215,7 +206,6 @@
phyp->phy = phy;
TAILQ_INSERT_TAIL(&sc->phy_list, phyp, next);
}
-#endif
if (GENERIC_USB_INIT(dev) != 0) {
err = ENXIO;
@@ -239,11 +229,9 @@
{
struct generic_ohci_softc *sc = device_get_softc(dev);
int err;
-#ifdef EXT_RESOURCES
struct clk_list *clk, *clk_tmp;
struct phy_list *phy, *phy_tmp;
struct hwrst_list *rst, *rst_tmp;
-#endif
/* during module unload there are lots of children leftover */
device_delete_children(dev);
@@ -282,7 +270,6 @@
}
usb_bus_mem_free_all(&sc->ohci_sc.sc_bus, &ohci_iterate_hw_softc);
-#ifdef EXT_RESOURCES
/* Disable phy */
TAILQ_FOREACH_SAFE(phy, &sc->phy_list, next, phy_tmp) {
err = phy_disable(phy->phy);
@@ -314,7 +301,6 @@
TAILQ_REMOVE(&sc->clk_list, clk, next);
free(clk, M_DEVBUF);
}
-#endif
if (GENERIC_USB_DEINIT(dev) != 0)
return (ENXIO);
diff --git a/sys/dev/usb/controller/generic_xhci_fdt.c b/sys/dev/usb/controller/generic_xhci_fdt.c
--- a/sys/dev/usb/controller/generic_xhci_fdt.c
+++ b/sys/dev/usb/controller/generic_xhci_fdt.c
@@ -53,9 +53,7 @@
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#ifdef EXT_RESOURCES
#include <dev/extres/phy/phy.h>
-#endif
#include "generic_xhci.h"
@@ -85,7 +83,6 @@
static int
generic_xhci_fdt_attach(device_t dev)
{
-#ifdef EXT_RESOURCES
phandle_t node;
phy_t phy;
@@ -93,7 +90,6 @@
if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0)
if (phy_enable(phy) != 0)
device_printf(dev, "Cannot enable phy\n");
-#endif
return (generic_xhci_attach(dev));
}
@@ -101,21 +97,17 @@
static int
generic_xhci_fdt_detach(device_t dev)
{
-#ifdef EXT_RESOURCES
phandle_t node;
phy_t phy;
-#endif
int err;
err = generic_xhci_detach(dev);
if (err != 0)
return (err);
-#ifdef EXT_RESOURCES
node = ofw_bus_get_node(dev);
if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0)
phy_release(phy);
-#endif
return (0);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 6, 9:19 PM (4 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38118705
Default Alt Text
D33827.id.diff (5 KB)

Event Timeline