[PATCH 03/11] serial pl010: get rid of map_base
Sascha Hauer
s.hauer at pengutronix.de
Thu Jul 28 09:41:56 EDT 2011
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/serial/serial_pl010.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/serial/serial_pl010.c b/drivers/serial/serial_pl010.c
index 7923ebb..9f7b7d3 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;
--
1.7.5.4
More information about the barebox
mailing list