diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2006-09-09 14:23:56 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-10-01 12:06:49 -0400 |
commit | 0b30d668a20acd2ffd4268f7bbe799b0dd73d5cf (patch) | |
tree | 2fd85c1f910ff4cec8f8ea499d78373c9a14648b | |
parent | f3d106881b06a423455f95916e666acebe6503f2 (diff) |
[SERIAL] 8250 resourse management fixes
I think register ranges obviously need to be claimed/released for all UARTs
including those with UPIO_MEM32 and UPIO_TSI iotype.
Also, serial8250_request_rsa_resources() returns false positives with
UPIO_MEM32, UPIO_AU, and UPIO_TSI iotype -- I don't think this makes any sense.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/serial/8250.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 0ae9ced00ed4..8d7ef69312a5 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -1949,6 +1949,8 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) | |||
1949 | case UPIO_AU: | 1949 | case UPIO_AU: |
1950 | size = 0x100000; | 1950 | size = 0x100000; |
1951 | /* fall thru */ | 1951 | /* fall thru */ |
1952 | case UPIO_TSI: | ||
1953 | case UPIO_MEM32: | ||
1952 | case UPIO_MEM: | 1954 | case UPIO_MEM: |
1953 | if (!up->port.mapbase) | 1955 | if (!up->port.mapbase) |
1954 | break; | 1956 | break; |
@@ -1984,6 +1986,8 @@ static void serial8250_release_std_resource(struct uart_8250_port *up) | |||
1984 | case UPIO_AU: | 1986 | case UPIO_AU: |
1985 | size = 0x100000; | 1987 | size = 0x100000; |
1986 | /* fall thru */ | 1988 | /* fall thru */ |
1989 | case UPIO_TSI: | ||
1990 | case UPIO_MEM32: | ||
1987 | case UPIO_MEM: | 1991 | case UPIO_MEM: |
1988 | if (!up->port.mapbase) | 1992 | if (!up->port.mapbase) |
1989 | break; | 1993 | break; |
@@ -2007,17 +2011,15 @@ static int serial8250_request_rsa_resource(struct uart_8250_port *up) | |||
2007 | { | 2011 | { |
2008 | unsigned long start = UART_RSA_BASE << up->port.regshift; | 2012 | unsigned long start = UART_RSA_BASE << up->port.regshift; |
2009 | unsigned int size = 8 << up->port.regshift; | 2013 | unsigned int size = 8 << up->port.regshift; |
2010 | int ret = 0; | 2014 | int ret = -EINVAL; |
2011 | 2015 | ||
2012 | switch (up->port.iotype) { | 2016 | switch (up->port.iotype) { |
2013 | case UPIO_MEM: | ||
2014 | ret = -EINVAL; | ||
2015 | break; | ||
2016 | |||
2017 | case UPIO_HUB6: | 2017 | case UPIO_HUB6: |
2018 | case UPIO_PORT: | 2018 | case UPIO_PORT: |
2019 | start += up->port.iobase; | 2019 | start += up->port.iobase; |
2020 | if (!request_region(start, size, "serial-rsa")) | 2020 | if (request_region(start, size, "serial-rsa")) |
2021 | ret = 0; | ||
2022 | else | ||
2021 | ret = -EBUSY; | 2023 | ret = -EBUSY; |
2022 | break; | 2024 | break; |
2023 | } | 2025 | } |
@@ -2031,9 +2033,6 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up) | |||
2031 | unsigned int size = 8 << up->port.regshift; | 2033 | unsigned int size = 8 << up->port.regshift; |
2032 | 2034 | ||
2033 | switch (up->port.iotype) { | 2035 | switch (up->port.iotype) { |
2034 | case UPIO_MEM: | ||
2035 | break; | ||
2036 | |||
2037 | case UPIO_HUB6: | 2036 | case UPIO_HUB6: |
2038 | case UPIO_PORT: | 2037 | case UPIO_PORT: |
2039 | release_region(up->port.iobase + offset, size); | 2038 | release_region(up->port.iobase + offset, size); |