Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Apr 2015 18:45:25 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r281077 - head/sys/dev/uart
Message-ID:  <201504041845.t34IjPgU099846@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sat Apr  4 18:45:25 2015
New Revision: 281077
URL: https://svnweb.freebsd.org/changeset/base/281077

Log:
  Move uart_fdt_get_clock and uart_fdt_get_shift to uart_bus_fdt.c, we may
  not build uart_cpu_fdt.c in all configs.

Modified:
  head/sys/dev/uart/uart_bus_fdt.c
  head/sys/dev/uart/uart_cpu_fdt.c

Modified: head/sys/dev/uart/uart_bus_fdt.c
==============================================================================
--- head/sys/dev/uart/uart_bus_fdt.c	Sat Apr  4 18:41:18 2015	(r281076)
+++ head/sys/dev/uart/uart_bus_fdt.c	Sat Apr  4 18:45:25 2015	(r281077)
@@ -63,6 +63,35 @@ static driver_t uart_fdt_driver = {
 	sizeof(struct uart_softc),
 };
 
+int
+uart_fdt_get_clock(phandle_t node, pcell_t *cell)
+{
+	pcell_t clock;
+
+	/* clock-frequency is a FreeBSD-only extention. */
+	if ((OF_getencprop(node, "clock-frequency", &clock,
+	    sizeof(clock))) <= 0)
+		clock = 0;
+
+	if (clock == 0)
+		/* Try to retrieve parent 'bus-frequency' */
+		/* XXX this should go to simple-bus fixup or so */
+		if ((OF_getencprop(OF_parent(node), "bus-frequency", &clock,
+		    sizeof(clock))) <= 0)
+			clock = 0;
+
+	return (0);
+}
+
+int
+uart_fdt_get_shift(phandle_t node, pcell_t *cell)
+{
+
+	if ((OF_getencprop(node, "reg-shift", cell, sizeof(*cell))) <= 0)
+		*cell = 0;
+	return (0);
+}
+
 static uintptr_t
 uart_fdt_find_device(device_t dev)
 {

Modified: head/sys/dev/uart/uart_cpu_fdt.c
==============================================================================
--- head/sys/dev/uart/uart_cpu_fdt.c	Sat Apr  4 18:41:18 2015	(r281076)
+++ head/sys/dev/uart/uart_cpu_fdt.c	Sat Apr  4 18:45:25 2015	(r281077)
@@ -59,35 +59,6 @@ bus_space_tag_t uart_bus_space_io;
 bus_space_tag_t uart_bus_space_mem;
 
 int
-uart_fdt_get_clock(phandle_t node, pcell_t *cell)
-{
-	pcell_t clock;
-
-	/* clock-frequency is a FreeBSD-only extention. */
-	if ((OF_getencprop(node, "clock-frequency", &clock,
-	    sizeof(clock))) <= 0)
-		clock = 0;
-
-	if (clock == 0)
-		/* Try to retrieve parent 'bus-frequency' */
-		/* XXX this should go to simple-bus fixup or so */
-		if ((OF_getencprop(OF_parent(node), "bus-frequency", &clock,
-		    sizeof(clock))) <= 0)
-			clock = 0;
-
-	return (0);
-}
-
-int
-uart_fdt_get_shift(phandle_t node, pcell_t *cell)
-{
-
-	if ((OF_getencprop(node, "reg-shift", cell, sizeof(*cell))) <= 0)
-		*cell = 0;
-	return (0);
-}
-
-int
 uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
 {
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504041845.t34IjPgU099846>