diff options
author | Greg Ungerer <gerg@snapgear.com> | 2008-02-01 02:38:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-02-01 05:00:01 -0500 |
commit | 9f69ba86d66297189916ceae401fe0944a207714 (patch) | |
tree | 9dada9de4f74f87bc28917da589112aba2098973 /drivers | |
parent | c9f27c3619b3ee26b8ec47692bdd3a7ac075ad87 (diff) |
m68knommu: use container_of in mcf.c
Use container_of() instead of assuming local uart struct is first member
of uart_port struct.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/mcf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c index a7d4360ea7df..051fcc2f5ba8 100644 --- a/drivers/serial/mcf.c +++ b/drivers/serial/mcf.c | |||
@@ -69,7 +69,7 @@ static unsigned int mcf_tx_empty(struct uart_port *port) | |||
69 | 69 | ||
70 | static unsigned int mcf_get_mctrl(struct uart_port *port) | 70 | static unsigned int mcf_get_mctrl(struct uart_port *port) |
71 | { | 71 | { |
72 | struct mcf_uart *pp = (struct mcf_uart *) port; | 72 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
73 | unsigned long flags; | 73 | unsigned long flags; |
74 | unsigned int sigs; | 74 | unsigned int sigs; |
75 | 75 | ||
@@ -87,7 +87,7 @@ static unsigned int mcf_get_mctrl(struct uart_port *port) | |||
87 | 87 | ||
88 | static void mcf_set_mctrl(struct uart_port *port, unsigned int sigs) | 88 | static void mcf_set_mctrl(struct uart_port *port, unsigned int sigs) |
89 | { | 89 | { |
90 | struct mcf_uart *pp = (struct mcf_uart *) port; | 90 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
91 | unsigned long flags; | 91 | unsigned long flags; |
92 | 92 | ||
93 | spin_lock_irqsave(&port->lock, flags); | 93 | spin_lock_irqsave(&port->lock, flags); |
@@ -104,7 +104,7 @@ static void mcf_set_mctrl(struct uart_port *port, unsigned int sigs) | |||
104 | 104 | ||
105 | static void mcf_start_tx(struct uart_port *port) | 105 | static void mcf_start_tx(struct uart_port *port) |
106 | { | 106 | { |
107 | struct mcf_uart *pp = (struct mcf_uart *) port; | 107 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
108 | unsigned long flags; | 108 | unsigned long flags; |
109 | 109 | ||
110 | spin_lock_irqsave(&port->lock, flags); | 110 | spin_lock_irqsave(&port->lock, flags); |
@@ -117,7 +117,7 @@ static void mcf_start_tx(struct uart_port *port) | |||
117 | 117 | ||
118 | static void mcf_stop_tx(struct uart_port *port) | 118 | static void mcf_stop_tx(struct uart_port *port) |
119 | { | 119 | { |
120 | struct mcf_uart *pp = (struct mcf_uart *) port; | 120 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
121 | unsigned long flags; | 121 | unsigned long flags; |
122 | 122 | ||
123 | spin_lock_irqsave(&port->lock, flags); | 123 | spin_lock_irqsave(&port->lock, flags); |
@@ -130,7 +130,7 @@ static void mcf_stop_tx(struct uart_port *port) | |||
130 | 130 | ||
131 | static void mcf_stop_rx(struct uart_port *port) | 131 | static void mcf_stop_rx(struct uart_port *port) |
132 | { | 132 | { |
133 | struct mcf_uart *pp = (struct mcf_uart *) port; | 133 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
134 | unsigned long flags; | 134 | unsigned long flags; |
135 | 135 | ||
136 | spin_lock_irqsave(&port->lock, flags); | 136 | spin_lock_irqsave(&port->lock, flags); |
@@ -163,7 +163,7 @@ static void mcf_enable_ms(struct uart_port *port) | |||
163 | 163 | ||
164 | static int mcf_startup(struct uart_port *port) | 164 | static int mcf_startup(struct uart_port *port) |
165 | { | 165 | { |
166 | struct mcf_uart *pp = (struct mcf_uart *) port; | 166 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
167 | unsigned long flags; | 167 | unsigned long flags; |
168 | 168 | ||
169 | spin_lock_irqsave(&port->lock, flags); | 169 | spin_lock_irqsave(&port->lock, flags); |
@@ -189,7 +189,7 @@ static int mcf_startup(struct uart_port *port) | |||
189 | 189 | ||
190 | static void mcf_shutdown(struct uart_port *port) | 190 | static void mcf_shutdown(struct uart_port *port) |
191 | { | 191 | { |
192 | struct mcf_uart *pp = (struct mcf_uart *) port; | 192 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
193 | unsigned long flags; | 193 | unsigned long flags; |
194 | 194 | ||
195 | spin_lock_irqsave(&port->lock, flags); | 195 | spin_lock_irqsave(&port->lock, flags); |
@@ -273,7 +273,7 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios, | |||
273 | 273 | ||
274 | static void mcf_rx_chars(struct mcf_uart *pp) | 274 | static void mcf_rx_chars(struct mcf_uart *pp) |
275 | { | 275 | { |
276 | struct uart_port *port = (struct uart_port *) pp; | 276 | struct uart_port *port = &pp->port; |
277 | unsigned char status, ch, flag; | 277 | unsigned char status, ch, flag; |
278 | 278 | ||
279 | while ((status = readb(port->membase + MCFUART_USR)) & MCFUART_USR_RXREADY) { | 279 | while ((status = readb(port->membase + MCFUART_USR)) & MCFUART_USR_RXREADY) { |
@@ -319,7 +319,7 @@ static void mcf_rx_chars(struct mcf_uart *pp) | |||
319 | 319 | ||
320 | static void mcf_tx_chars(struct mcf_uart *pp) | 320 | static void mcf_tx_chars(struct mcf_uart *pp) |
321 | { | 321 | { |
322 | struct uart_port *port = (struct uart_port *) pp; | 322 | struct uart_port *port = &pp->port; |
323 | struct circ_buf *xmit = &port->info->xmit; | 323 | struct circ_buf *xmit = &port->info->xmit; |
324 | 324 | ||
325 | if (port->x_char) { | 325 | if (port->x_char) { |
@@ -352,7 +352,7 @@ static void mcf_tx_chars(struct mcf_uart *pp) | |||
352 | static irqreturn_t mcf_interrupt(int irq, void *data) | 352 | static irqreturn_t mcf_interrupt(int irq, void *data) |
353 | { | 353 | { |
354 | struct uart_port *port = data; | 354 | struct uart_port *port = data; |
355 | struct mcf_uart *pp = (struct mcf_uart *) port; | 355 | struct mcf_uart *pp = container_of(port, struct mcf_uart, port); |
356 | unsigned int isr; | 356 | unsigned int isr; |
357 | 357 | ||
358 | isr = readb(port->membase + MCFUART_UISR) & pp->imr; | 358 | isr = readb(port->membase + MCFUART_UISR) & pp->imr; |