[PATCH 4/4] nios2/serial_altera_jtag.c: switch to ressources

franck.jullien at gmail.com franck.jullien at gmail.com
Mon Jul 25 15:50:20 EDT 2011


From: Franck Jullien <franck.jullien at gmail.com>

Signed-off-by: Franck Jullien <franck.jullien at gmail.com>
---
 drivers/serial/serial_altera_jtag.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/serial_altera_jtag.c b/drivers/serial/serial_altera_jtag.c
index 322f9e9..7d42382 100644
--- a/drivers/serial/serial_altera_jtag.c
+++ b/drivers/serial/serial_altera_jtag.c
@@ -37,7 +37,7 @@ static int altera_serial_jtag_setbaudrate(struct console_device *cdev, int baudr
 
 static void altera_serial_jtag_putc(struct console_device *cdev, char c)
 {
-	struct nios_jtag *jtag = (struct nios_jtag *)cdev->dev->map_base;
+	struct nios_jtag *jtag = (struct nios_jtag *)dev_request_mem_region(cdev->dev, 0);
 	uint32_t st;
 
 	while (1) {
@@ -51,14 +51,14 @@ static void altera_serial_jtag_putc(struct console_device *cdev, char c)
 
 static int altera_serial_jtag_tstc(struct console_device *cdev)
 {
-	struct nios_jtag *jtag = (struct nios_jtag *)cdev->dev->map_base;
+	struct nios_jtag *jtag = (struct nios_jtag *)dev_request_mem_region(cdev->dev, 0);
 
 	return readl(&jtag->control) & NIOS_JTAG_RRDY;
 }
 
 static int altera_serial_jtag_getc(struct console_device *cdev)
 {
-	struct nios_jtag *jtag = (struct nios_jtag *)cdev->dev->map_base;
+	struct nios_jtag *jtag = (struct nios_jtag *)dev_request_mem_region(cdev->dev, 0);
 	uint32_t val;
 
 	while (1) {
-- 
1.7.1




More information about the barebox mailing list