diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2015-02-24 14:25:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-26 13:18:20 -0400 |
commit | cd52b7599c1a1150719b2f6d20bce6b4f30dc8df (patch) | |
tree | a0467d11b281d06ee6e6b0503a8fde2a08dcbaa1 /drivers/tty/serial | |
parent | d53e1428a9f1110ec865b2839f6a6f12d13da2b9 (diff) |
serial: 8250: Get RSA resource iff CONFIG_SERIAL_8250_RSA
Support for Remote Supervisor Adapter is conditional on
CONFIG_SERIAL_8250_RSA; only attempt RSA resource acquire if
defined.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/8250/8250_core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 423a77903cef..dcfe5500303f 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c | |||
@@ -2797,6 +2797,7 @@ static void serial8250_release_std_resource(struct uart_8250_port *up) | |||
2797 | } | 2797 | } |
2798 | } | 2798 | } |
2799 | 2799 | ||
2800 | #ifdef CONFIG_SERIAL_8250_RSA | ||
2800 | static int serial8250_request_rsa_resource(struct uart_8250_port *up) | 2801 | static int serial8250_request_rsa_resource(struct uart_8250_port *up) |
2801 | { | 2802 | { |
2802 | unsigned long start = UART_RSA_BASE << up->port.regshift; | 2803 | unsigned long start = UART_RSA_BASE << up->port.regshift; |
@@ -2831,14 +2832,17 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up) | |||
2831 | break; | 2832 | break; |
2832 | } | 2833 | } |
2833 | } | 2834 | } |
2835 | #endif | ||
2834 | 2836 | ||
2835 | static void serial8250_release_port(struct uart_port *port) | 2837 | static void serial8250_release_port(struct uart_port *port) |
2836 | { | 2838 | { |
2837 | struct uart_8250_port *up = up_to_u8250p(port); | 2839 | struct uart_8250_port *up = up_to_u8250p(port); |
2838 | 2840 | ||
2839 | serial8250_release_std_resource(up); | 2841 | serial8250_release_std_resource(up); |
2842 | #ifdef CONFIG_SERIAL_8250_RSA | ||
2840 | if (port->type == PORT_RSA) | 2843 | if (port->type == PORT_RSA) |
2841 | serial8250_release_rsa_resource(up); | 2844 | serial8250_release_rsa_resource(up); |
2845 | #endif | ||
2842 | } | 2846 | } |
2843 | 2847 | ||
2844 | static int serial8250_request_port(struct uart_port *port) | 2848 | static int serial8250_request_port(struct uart_port *port) |
@@ -2850,11 +2854,13 @@ static int serial8250_request_port(struct uart_port *port) | |||
2850 | return -ENODEV; | 2854 | return -ENODEV; |
2851 | 2855 | ||
2852 | ret = serial8250_request_std_resource(up); | 2856 | ret = serial8250_request_std_resource(up); |
2857 | #ifdef CONFIG_SERIAL_8250_RSA | ||
2853 | if (ret == 0 && port->type == PORT_RSA) { | 2858 | if (ret == 0 && port->type == PORT_RSA) { |
2854 | ret = serial8250_request_rsa_resource(up); | 2859 | ret = serial8250_request_rsa_resource(up); |
2855 | if (ret < 0) | 2860 | if (ret < 0) |
2856 | serial8250_release_std_resource(up); | 2861 | serial8250_release_std_resource(up); |
2857 | } | 2862 | } |
2863 | #endif | ||
2858 | 2864 | ||
2859 | return ret; | 2865 | return ret; |
2860 | } | 2866 | } |
@@ -3016,9 +3022,11 @@ static void serial8250_config_port(struct uart_port *port, int flags) | |||
3016 | if (ret < 0) | 3022 | if (ret < 0) |
3017 | return; | 3023 | return; |
3018 | 3024 | ||
3025 | #ifdef CONFIG_SERIAL_8250_RSA | ||
3019 | ret = serial8250_request_rsa_resource(up); | 3026 | ret = serial8250_request_rsa_resource(up); |
3020 | if (ret < 0) | 3027 | if (ret < 0) |
3021 | probeflags &= ~PROBE_RSA; | 3028 | probeflags &= ~PROBE_RSA; |
3029 | #endif | ||
3022 | 3030 | ||
3023 | if (port->iotype != up->cur_iotype) | 3031 | if (port->iotype != up->cur_iotype) |
3024 | set_io_from_upio(port); | 3032 | set_io_from_upio(port); |
@@ -3037,8 +3045,10 @@ static void serial8250_config_port(struct uart_port *port, int flags) | |||
3037 | if (port->type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ) | 3045 | if (port->type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ) |
3038 | autoconfig_irq(up); | 3046 | autoconfig_irq(up); |
3039 | 3047 | ||
3048 | #ifdef CONFIG_SERIAL_8250_RSA | ||
3040 | if (port->type != PORT_RSA && probeflags & PROBE_RSA) | 3049 | if (port->type != PORT_RSA && probeflags & PROBE_RSA) |
3041 | serial8250_release_rsa_resource(up); | 3050 | serial8250_release_rsa_resource(up); |
3051 | #endif | ||
3042 | if (port->type == PORT_UNKNOWN) | 3052 | if (port->type == PORT_UNKNOWN) |
3043 | serial8250_release_std_resource(up); | 3053 | serial8250_release_std_resource(up); |
3044 | 3054 | ||