[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1556369542-13247-33-git-send-email-info@metux.net>
Date: Sat, 27 Apr 2019 14:52:13 +0200
From: "Enrico Weigelt, metux IT consult" <info@...ux.net>
To: linux-kernel@...r.kernel.org
Cc: gregkh@...uxfoundation.org, andrew@...id.au,
andriy.shevchenko@...ux.intel.com, macro@...ux-mips.org,
vz@...ia.com, slemieux.tyco@...il.com, khilman@...libre.com,
liviu.dudau@....com, sudeep.holla@....com,
lorenzo.pieralisi@....com, davem@...emloft.net, jacmet@...site.dk,
linux@...sktech.co.nz, matthias.bgg@...il.com,
linux-mips@...r.kernel.org, linux-serial@...r.kernel.org,
linux-ia64@...r.kernel.org, linux-amlogic@...ts.infradead.org,
linuxppc-dev@...ts.ozlabs.org, sparclinux@...r.kernel.org
Subject: [PATCH 32/41] drivers: tty: serial: 21285: define's for address/size, use mapsize field
Instead of hardcoding raw numbers, add define's for the mmio address/size.
Also fill the mapsize field and use it on mem request/release calls, for
more consistency and allowing generic helpers to be used later.
Signed-off-by: Enrico Weigelt <info@...ux.net>
---
drivers/tty/serial/21285.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c
index 32b3acf..90684cd 100644
--- a/drivers/tty/serial/21285.c
+++ b/drivers/tty/serial/21285.c
@@ -27,6 +27,9 @@
#define SERIAL_21285_MAJOR 204
#define SERIAL_21285_MINOR 4
+#define SERIAL_21285_ADDRESS 0x42000160
+#define SERIAL_21285_SIZE 32
+
#define RXSTAT_DUMMY_READ 0x80000000
#define RXSTAT_FRAME (1 << 0)
#define RXSTAT_PARITY (1 << 1)
@@ -305,12 +308,14 @@ static const char *serial21285_type(struct uart_port *port)
static void serial21285_release_port(struct uart_port *port)
{
- release_mem_region(port->mapbase, 32);
+ release_mem_region(port->mapbase, port->mapsize);
}
static int serial21285_request_port(struct uart_port *port)
{
- return request_mem_region(port->mapbase, 32, serial21285_name)
+ return request_mem_region(port->mapbase,
+ port->mapsize,
+ serial21285_name)
!= NULL ? 0 : -EBUSY;
}
@@ -354,7 +359,8 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct
};
static struct uart_port serial21285_port = {
- .mapbase = 0x42000160,
+ .mapbase = SERIAL_21285_BASE,
+ .mapsize = SERIAL_21285_SIZE,
.iotype = UPIO_MEM,
.irq = 0,
.fifosize = 16,
--
1.9.1
Powered by blists - more mailing lists