aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/sa11x0/uart_dev_sa1110.c
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2007-04-02 22:00:22 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2007-04-02 22:00:22 +0000
commitf8100ce2a70db5c60672578fee913d986ac1cf01 (patch)
treeb3ad51f3cb65c3badfb015aea4f71d800157abb8 /sys/arm/sa11x0/uart_dev_sa1110.c
parent1bdb3fb97eb936148ebd3be52850c09ae7f72260 (diff)
downloadsrc-f8100ce2a70db5c60672578fee913d986ac1cf01.tar.gz
src-f8100ce2a70db5c60672578fee913d986ac1cf01.zip
Don't expose the uart_ops structure directly, but instead have
it obtained through the uart_class structure. This allows us to declare the uart_class structure as weak and as such allows us to reference it even when it's not compiled-in. It also allows is to get the uart_ops structure by name, which makes it possible to implement the dt tag handling in uart_getenv(). The side-effect of all this is that we're using the uart_class structure more consistently which means that we now also have access to the size of the bus space block needed by the hardware when we map the bus space, eliminating any hardcoding.
Notes
Notes: svn path=/head/; revision=168281
Diffstat (limited to 'sys/arm/sa11x0/uart_dev_sa1110.c')
-rw-r--r--sys/arm/sa11x0/uart_dev_sa1110.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arm/sa11x0/uart_dev_sa1110.c b/sys/arm/sa11x0/uart_dev_sa1110.c
index 0a36bca11625..35ff22bc00d3 100644
--- a/sys/arm/sa11x0/uart_dev_sa1110.c
+++ b/sys/arm/sa11x0/uart_dev_sa1110.c
@@ -57,7 +57,7 @@ static int sa1110_getc(struct uart_bas *bas, struct mtx *mtx);
extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
-struct uart_ops uart_sa1110_ops = {
+static struct uart_ops uart_sa1110_ops = {
.probe = sa1110_probe,
.init = sa1110_init,
.term = sa1110_term,
@@ -272,10 +272,12 @@ sa1110_bus_ioctl(struct uart_softc *sc, int request, intptr_t data)
{
return (EINVAL);
}
+
struct uart_class uart_sa1110_class = {
- "sa1110 class",
+ "sa1110",
sa1110_methods,
1,
+ .uc_ops = &uart_sa1110_ops,
.uc_range = 8,
.uc_rclk = 3686400
};