Skip to contentSkip to conversation

Change ucc_geth driver to use of_device

PATCH In review Kim Phillips 1 participant 1 message Sep 30, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 12/15 Change ucc_geth driver to use of_device

Change ucc_geth driver to use of_device

This patch change ucc_geth driver to use of_device from platform_device. It also fix a bug that bcsr_regs gets accidentally unmapped. Remove trailing space.

---
 arch/powerpc/sysdev/qe_lib/Makefile    |    2 -
 arch/powerpc/sysdev/qe_lib/qe_common.c |   22 ++++++
 drivers/net/ucc_geth.c                 |  119 +++++++++++++++++++++++---------
 3 files changed, 110 insertions(+), 33 deletions(-)
arch/powerpc/sysdev/qe_lib/Makefile +1 -1
index 9a54a81..316a63c 100644
@@ -1,7 +1,7 @@
 #
 # Makefile for the linux ppc-specific parts of QE
 #
-obj-$(CONFIG_QUICC_ENGINE)+= qe_common.o qe.o qe_ic.o qe_io.o
+obj-$(CONFIG_QUICC_ENGINE)+= qe_common.o qe_ic.o qe_io.o
 
 obj-$(CONFIG_UCC)	+= ucc.o
 obj-$(CONFIG_UCC_SLOW)	+= ucc_slow.o
arch/powerpc/sysdev/qe_lib/qe_common.c +22 -0
index 0cde73c..5c3381f 100644
@@ -60,6 +60,28 @@ static int qe_sdma_init(void);
 
 static DEFINE_SPINLOCK(qe_lock);
 
+static phys_addr_t qebase = -1;
+
+phys_addr_t get_qe_base(void)
+{
+	struct device_node *qe;
+
+	if (qebase != -1)
+		return qebase;
+
+	qe = of_find_node_by_type(NULL, "qe");
+	if (qe) {
+		unsigned int size;
+		void *prop = get_property(qe, "reg", &size);
+		qebase = of_translate_address(qe, prop);
+		of_node_put(qe);
+	};
+
+	return qebase;
+}
+
+EXPORT_SYMBOL(get_qe_base);
+
 void qe_reset(void)
 {
 	if (qe_immr == NULL)
drivers/net/ucc_geth.c +87 -32

193 lines not on this page · raw message

Signature · 1 line
1.4.2.1