aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-12-06 04:59:52 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-12-24 07:50:54 -0500
commit89b5c1ab94a1cea921d8a280de0a483d71af5091 (patch)
tree9320e645ee03081a58046c2d32810b04e7d27dfc /drivers/tty/serial
parent878fbb91399df0d37e0183890b0ad6aeb63590fe (diff)
serial: sh-sci: Remove platform data mapbase and irqs fields
The fields are not used anymore by board files, remove them. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/sh-sci.c60
1 files changed, 34 insertions, 26 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 96d26d7f8031..c4111162ec5e 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -58,6 +58,23 @@
58 58
59#include "sh-sci.h" 59#include "sh-sci.h"
60 60
61/* Offsets into the sci_port->irqs array */
62enum {
63 SCIx_ERI_IRQ,
64 SCIx_RXI_IRQ,
65 SCIx_TXI_IRQ,
66 SCIx_BRI_IRQ,
67 SCIx_NR_IRQS,
68
69 SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
70};
71
72#define SCIx_IRQ_IS_MUXED(port) \
73 ((port)->irqs[SCIx_ERI_IRQ] == \
74 (port)->irqs[SCIx_RXI_IRQ]) || \
75 ((port)->irqs[SCIx_ERI_IRQ] && \
76 ((port)->irqs[SCIx_RXI_IRQ] < 0))
77
61struct sci_port { 78struct sci_port {
62 struct uart_port port; 79 struct uart_port port;
63 80
@@ -2094,36 +2111,27 @@ static int sci_init_single(struct platform_device *dev,
2094 port->iotype = UPIO_MEM; 2111 port->iotype = UPIO_MEM;
2095 port->line = index; 2112 port->line = index;
2096 2113
2097 if (dev->num_resources) { 2114 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
2098 /* Device has resources, use them. */ 2115 if (res == NULL)
2099 res = platform_get_resource(dev, IORESOURCE_MEM, 0); 2116 return -ENOMEM;
2100 if (res == NULL)
2101 return -ENOMEM;
2102 2117
2103 port->mapbase = res->start; 2118 port->mapbase = res->start;
2104 2119
2105 for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i) 2120 for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i)
2106 sci_port->irqs[i] = platform_get_irq(dev, i); 2121 sci_port->irqs[i] = platform_get_irq(dev, i);
2107 2122
2108 /* The SCI generates several interrupts. They can be muxed 2123 /* The SCI generates several interrupts. They can be muxed together or
2109 * together or connected to different interrupt lines. In the 2124 * connected to different interrupt lines. In the muxed case only one
2110 * muxed case only one interrupt resource is specified. In the 2125 * interrupt resource is specified. In the non-muxed case three or four
2111 * non-muxed case three or four interrupt resources are 2126 * interrupt resources are specified, as the BRI interrupt is optional.
2112 * specified, as the BRI interrupt is optional. 2127 */
2113 */ 2128 if (sci_port->irqs[0] < 0)
2114 if (sci_port->irqs[0] < 0) 2129 return -ENXIO;
2115 return -ENXIO;
2116 2130
2117 if (sci_port->irqs[1] < 0) { 2131 if (sci_port->irqs[1] < 0) {
2118 sci_port->irqs[1] = sci_port->irqs[0]; 2132 sci_port->irqs[1] = sci_port->irqs[0];
2119 sci_port->irqs[2] = sci_port->irqs[0]; 2133 sci_port->irqs[2] = sci_port->irqs[0];
2120 sci_port->irqs[3] = sci_port->irqs[0]; 2134 sci_port->irqs[3] = sci_port->irqs[0];
2121 }
2122 } else {
2123 /* No resources, use old-style platform data. */
2124 port->mapbase = p->mapbase;
2125 for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i)
2126 sci_port->irqs[i] = p->irqs[i] ? p->irqs[i] : -ENXIO;
2127 } 2135 }
2128 2136
2129 if (p->regtype == SCIx_PROBE_REGTYPE) { 2137 if (p->regtype == SCIx_PROBE_REGTYPE) {