Change ucc_geth driver to use of_device
Subsystems (2)
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.
Sign-off-by Li Yang <[email protected]>
--- 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
@@ -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
@@ -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