summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-01-06 19:36:57 +0400
committerAlejandro Mery <amery@geeks.cl>2013-01-14 14:35:49 +0400
commit7225a3b88a68d6f34d4232a24a4cc68f3baf1b28 (patch)
tree1368abc80832ab451c4cad1cfc1f079bef5170d5
parent2ed91d356935e516b0b8c52d5e919c77b59b09fc (diff)
downloadlinux-sunxi-7225a3b88a68d6f34d4232a24a4cc68f3baf1b28.tar.xz
sunxi-serial: No need to keep the port struct in memory
Since it is only a template we don't need to keep it around. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rwxr-xr-xdrivers/tty/serial/8250_sunxi.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/tty/serial/8250_sunxi.c b/drivers/tty/serial/8250_sunxi.c
index 8709e4cd2bc5..f5bd2706dc4a 100755
--- a/drivers/tty/serial/8250_sunxi.c
+++ b/drivers/tty/serial/8250_sunxi.c
@@ -45,8 +45,6 @@ static int sw_serial[MAX_PORTS];
#define RESSIZE(res) (((res)->end - (res)->start)+1)
struct sw_serial_port {
- struct uart_port port;
- char name[16];
int port_no;
int pin_num;
u32 pio_hdle;
@@ -165,6 +163,7 @@ static int __devinit
sw_serial_probe(struct platform_device *dev)
{
struct sw_serial_port *sport;
+ struct uart_port port = {};
int ret;
sport = kzalloc(sizeof(struct sw_serial_port), GFP_KERNEL);
@@ -186,21 +185,22 @@ sw_serial_probe(struct platform_device *dev)
}
platform_set_drvdata(dev, sport);
- sport->port.private_data = sport;
- sport->port.irq = sport->irq;
- sport->port.fifosize= 64;
- sport->port.regshift= 2;
- sport->port.iotype = UPIO_DWAPB32;
- sport->port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
- sport->port.uartclk = sport->sclk;
- sport->port.pm = sw_serial_pm;
- sport->port.dev = &dev->dev;
-
- sport->port.mapbase = sport->mmres->start;
- sw_serial[sport->port_no] = serial8250_register_port(&sport->port);
- UART_MSG("serial probe %d, membase %p irq %d mapbase 0x%08x\n",
- dev->id, sport->port.membase, sport->port.irq, sport->port.mapbase);
-
+ port.private_data = sport;
+ port.irq = sport->irq;
+ port.mapbase = sport->mmres->start;
+ port.fifosize = 64;
+ port.regshift = 2;
+ port.iotype = UPIO_DWAPB32;
+ port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
+ port.uartclk = sport->sclk;
+ port.pm = sw_serial_pm;
+ port.dev = &dev->dev;
+
+ pr_info("serial probe %d irq %d mapbase 0x%08x\n", dev->id,
+ sport->irq, sport->mmres->start);
+
+ sw_serial[sport->port_no] = serial8250_register_port(&port);
+
return 0;
free_dev:
kfree(sport);