diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-07-14 14:26:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-17 18:16:23 -0700 |
commit | b1261c86fe238cc0da3f5dc837a38a0c39f3e7c4 (patch) | |
tree | 4a62c30754e5aca7cf5c665efeabf545b69d52da /include/linux/serial_8250.h | |
parent | 380c966c093e7239e42a81f165b20b2bad2658bc (diff) | |
download | op-kernel-dev-b1261c86fe238cc0da3f5dc837a38a0c39f3e7c4.zip op-kernel-dev-b1261c86fe238cc0da3f5dc837a38a0c39f3e7c4.tar.gz |
serial: 8250: introduce up_to_u8250p() helper
It helps to cast struct uart_port to struct uart_8250_port at runtime.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serial_8250.h')
-rw-r--r-- | include/linux/serial_8250.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index af47a8a..730ab4b 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -100,6 +100,11 @@ struct uart_8250_port { void (*dl_write)(struct uart_8250_port *, int); }; +static inline struct uart_8250_port *up_to_u8250p(struct uart_port *up) +{ + return container_of(up, struct uart_8250_port, port); +} + int serial8250_register_8250_port(struct uart_8250_port *); void serial8250_unregister_port(int line); void serial8250_suspend_port(int line); |