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>
This commit is contained in:
Andy Shevchenko 2014-07-14 14:26:14 +03:00 committed by Greg Kroah-Hartman
parent 380c966c09
commit b1261c86fe
5 changed files with 32 additions and 47 deletions

View file

@ -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);