aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/8250.c
diff options
context:
space:
mode:
authorAndré Goddard Rosa <andre.goddard@gmail.com>2009-10-25 10:01:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 18:18:04 -0500
commit4c0ebb8057bc335d345c8e205a3e6fd1320be21e (patch)
tree71625bdd54cbc50b6abaaa92a3b2d063b45947fe /drivers/serial/8250.c
parent82cb7ba10deafe17686bf22ce4a7a303a77a197f (diff)
serial, 8250: calculate irqflags bitmask before loop
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r--drivers/serial/8250.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 737b4c960971..b75e63e9d1ee 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2646,7 +2646,7 @@ static void __init serial8250_isa_init_ports(void)
2646{ 2646{
2647 struct uart_8250_port *up; 2647 struct uart_8250_port *up;
2648 static int first = 1; 2648 static int first = 1;
2649 int i; 2649 int i, irqflag = 0;
2650 2650
2651 if (!first) 2651 if (!first)
2652 return; 2652 return;
@@ -2670,6 +2670,9 @@ static void __init serial8250_isa_init_ports(void)
2670 up->port.ops = &serial8250_pops; 2670 up->port.ops = &serial8250_pops;
2671 } 2671 }
2672 2672
2673 if (share_irqs)
2674 irqflag = IRQF_SHARED;
2675
2673 for (i = 0, up = serial8250_ports; 2676 for (i = 0, up = serial8250_ports;
2674 i < ARRAY_SIZE(old_serial_port) && i < nr_uarts; 2677 i < ARRAY_SIZE(old_serial_port) && i < nr_uarts;
2675 i++, up++) { 2678 i++, up++) {
@@ -2683,8 +2686,7 @@ static void __init serial8250_isa_init_ports(void)
2683 up->port.iotype = old_serial_port[i].io_type; 2686 up->port.iotype = old_serial_port[i].io_type;
2684 up->port.regshift = old_serial_port[i].iomem_reg_shift; 2687 up->port.regshift = old_serial_port[i].iomem_reg_shift;
2685 set_io_from_upio(&up->port); 2688 set_io_from_upio(&up->port);
2686 if (share_irqs) 2689 up->port.irqflags |= irqflag;
2687 up->port.irqflags |= IRQF_SHARED;
2688 } 2690 }
2689} 2691}
2690 2692
@@ -2940,10 +2942,13 @@ static int __devinit serial8250_probe(struct platform_device *dev)
2940{ 2942{
2941 struct plat_serial8250_port *p = dev->dev.platform_data; 2943 struct plat_serial8250_port *p = dev->dev.platform_data;
2942 struct uart_port port; 2944 struct uart_port port;
2943 int ret, i; 2945 int ret, i, irqflag = 0;
2944 2946
2945 memset(&port, 0, sizeof(struct uart_port)); 2947 memset(&port, 0, sizeof(struct uart_port));
2946 2948
2949 if (share_irqs)
2950 irqflag = IRQF_SHARED;
2951
2947 for (i = 0; p && p->flags != 0; p++, i++) { 2952 for (i = 0; p && p->flags != 0; p++, i++) {
2948 port.iobase = p->iobase; 2953 port.iobase = p->iobase;
2949 port.membase = p->membase; 2954 port.membase = p->membase;
@@ -2960,8 +2965,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
2960 port.serial_in = p->serial_in; 2965 port.serial_in = p->serial_in;
2961 port.serial_out = p->serial_out; 2966 port.serial_out = p->serial_out;
2962 port.dev = &dev->dev; 2967 port.dev = &dev->dev;
2963 if (share_irqs) 2968 port.irqflags |= irqflag;
2964 port.irqflags |= IRQF_SHARED;
2965 ret = serial8250_register_port(&port); 2969 ret = serial8250_register_port(&port);
2966 if (ret < 0) { 2970 if (ret < 0) {
2967 dev_err(&dev->dev, "unable to register port at index %d " 2971 dev_err(&dev->dev, "unable to register port at index %d "