summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_pl010.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-07-28 15:08:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-07-28 15:08:41 +0200
commit36a16d65092b0415e56b6beaaf1bf092f64cfbd6 (patch)
tree6b781646d10b4cddc353f8d9efae40b0a2a48acf /drivers/serial/serial_pl010.c
parentf0c13327809000e449b6d50f19c461fc58da26ad (diff)
downloadbarebox-36a16d65092b0415e56b6beaaf1bf092f64cfbd6.tar.gz
barebox-36a16d65092b0415e56b6beaaf1bf092f64cfbd6.tar.xz
serial pl010: get rid of map_base
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/serial_pl010.c')
-rw-r--r--drivers/serial/serial_pl010.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/serial/serial_pl010.c b/drivers/serial/serial_pl010.c
index 7923ebb788..9f7b7d3b02 100644
--- a/drivers/serial/serial_pl010.c
+++ b/drivers/serial/serial_pl010.c
@@ -37,7 +37,7 @@
static int pl010_setbaudrate(struct console_device *cdev, int baudrate)
{
- struct pl010_struct *pl010 = (struct pl010_struct *)cdev->dev->map_base;
+ struct pl010_struct *pl010 = cdev->dev->priv;
unsigned int divisor;
switch (baudrate) {
@@ -76,7 +76,7 @@ static int pl010_setbaudrate(struct console_device *cdev, int baudrate)
static int pl010_init_port(struct console_device *cdev)
{
- struct pl010_struct *pl010 = (struct pl010_struct *)cdev->dev->map_base;
+ struct pl010_struct *pl010 = cdev->dev->priv;
/*
* First, disable everything.
@@ -99,7 +99,7 @@ static int pl010_init_port(struct console_device *cdev)
static void pl010_putc(struct console_device *cdev, char c)
{
- struct pl010_struct *pl010 = (struct pl010_struct *)cdev->dev->map_base;
+ struct pl010_struct *pl010 = cdev->dev->priv;
/* Wait until there is space in the FIFO */
while (readl(&pl010->flag) & UART_PL010_FR_TXFF)
@@ -111,7 +111,7 @@ static void pl010_putc(struct console_device *cdev, char c)
static int pl010_getc(struct console_device *cdev)
{
- struct pl010_struct *pl010 = (struct pl010_struct *)cdev->dev->map_base;
+ struct pl010_struct *pl010 = cdev->dev->priv;
unsigned int data;
/* Wait until there is data in the FIFO */
@@ -132,7 +132,7 @@ static int pl010_getc(struct console_device *cdev)
static int pl010_tstc(struct console_device *cdev)
{
- struct pl010_struct *pl010 = (struct pl010_struct *)cdev->dev->map_base;
+ struct pl010_struct *pl010 = cdev->dev->priv;
return !(readl(&pl010->flag) & UART_PL010_FR_RXFE);
}
@@ -143,6 +143,7 @@ static int pl010_probe(struct device_d *dev)
cdev = xmalloc(sizeof(struct console_device));
dev->type_data = cdev;
+ dev->priv = dev_request_mem_region(dev, 0);
cdev->dev = dev;
cdev->f_caps = CONSOLE_STDIN | CONSOLE_STDOUT | CONSOLE_STDERR;
cdev->tstc = pl010_tstc;