Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107410642
D33828.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D33828.diff
View Options
diff --git a/sys/dev/uart/uart_dev_snps.c b/sys/dev/uart/uart_dev_snps.c
--- a/sys/dev/uart/uart_dev_snps.c
+++ b/sys/dev/uart/uart_dev_snps.c
@@ -43,21 +43,17 @@
#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>
-#endif
#include "uart_if.h"
struct snps_softc {
struct ns8250_softc ns8250;
-#ifdef EXT_RESOURCES
clk_t baudclk;
clk_t apb_pclk;
hwreset_t reset;
-#endif
};
/*
@@ -131,7 +127,6 @@
};
UART_FDT_CLASS(compat_data);
-#ifdef EXT_RESOURCES
static int
snps_get_clocks(device_t dev, clk_t *baudclk, clk_t *apb_pclk)
{
@@ -151,7 +146,6 @@
return (0);
}
-#endif
static int
snps_probe(device_t dev)
@@ -162,10 +156,8 @@
uint32_t shift, iowidth, clock;
uint64_t freq;
int error;
-#ifdef EXT_RESOURCES
clk_t baudclk, apb_pclk;
hwreset_t reset;
-#endif
if (!ofw_bus_status_okay(dev))
return (ENXIO);
@@ -187,7 +179,6 @@
if (OF_getencprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0)
clock = 0;
-#ifdef EXT_RESOURCES
if (hwreset_get_by_ofw_idx(dev, 0, 0, &reset) == 0) {
error = hwreset_deassert(reset);
if (error != 0) {
@@ -220,7 +211,6 @@
clock = (uint32_t)freq;
}
}
-#endif
if (bootverbose && clock == 0)
device_printf(dev, "could not determine frequency\n");
@@ -229,7 +219,6 @@
if (error != 0)
return (error);
-#ifdef EXT_RESOURCES
/* XXX uart_bus_probe has changed the softc, so refresh it */
sc = device_get_softc(dev);
@@ -237,7 +226,6 @@
sc->baudclk = baudclk;
sc->apb_pclk = apb_pclk;
sc->reset = reset;
-#endif
return (0);
}
@@ -245,25 +233,20 @@
static int
snps_detach(device_t dev)
{
-#ifdef EXT_RESOURCES
struct snps_softc *sc;
clk_t baudclk, apb_pclk;
hwreset_t reset;
-#endif
int error;
-#ifdef EXT_RESOURCES
sc = device_get_softc(dev);
baudclk = sc->baudclk;
apb_pclk = sc->apb_pclk;
reset = sc->reset;
-#endif
error = uart_bus_detach(dev);
if (error != 0)
return (error);
-#ifdef EXT_RESOURCES
if (reset != NULL) {
error = hwreset_assert(reset);
if (error != 0) {
@@ -286,7 +269,6 @@
return (error);
}
}
-#endif
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 14, 6:28 PM (6 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15799460
Default Alt Text
D33828.diff (2 KB)
Attached To
Mode
D33828: uart_dev_snps: Make ext_resources non-optional
Attached
Detach File
Event Timeline
Log In to Comment