static unsigned int mcf_get_mctrl(struct uart_port *port)
{
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned long flags;
unsigned int sigs;
static void mcf_set_mctrl(struct uart_port *port, unsigned int sigs)
{
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
static void mcf_start_tx(struct uart_port *port)
{
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
static void mcf_stop_tx(struct uart_port *port)
{
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
static void mcf_stop_rx(struct uart_port *port)
{
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
static int mcf_startup(struct uart_port *port)
{
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
static void mcf_shutdown(struct uart_port *port)
{
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
static void mcf_rx_chars(struct mcf_uart *pp)
{
- struct uart_port *port = (struct uart_port *) pp;
+ struct uart_port *port = &pp->port;
unsigned char status, ch, flag;
while ((status = readb(port->membase + MCFUART_USR)) & MCFUART_USR_RXREADY) {
static void mcf_tx_chars(struct mcf_uart *pp)
{
- struct uart_port *port = (struct uart_port *) pp;
+ struct uart_port *port = &pp->port;
struct circ_buf *xmit = &port->info->xmit;
if (port->x_char) {
static irqreturn_t mcf_interrupt(int irq, void *data)
{
struct uart_port *port = data;
- struct mcf_uart *pp = (struct mcf_uart *) port;
+ struct mcf_uart *pp = container_of(port, struct mcf_uart, port);
unsigned int isr;
isr = readb(port->membase + MCFUART_UISR) & pp->imr;