serial: imx: drop members from driver data that are only used during probe
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 24 Feb 2015 10:17:07 +0000 (11:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 02:26:32 +0000 (03:26 +0100)
There is no benefit in keeping this information in RAM when it's not
used any more, so better use function local variables instead.

These members are unused since c0d1c6b0f0dc ("serial: imx: Fix the
reporting of interrupts")

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index 9e3a8ffe97b426a68a495740837539ac7fb10d65..65251984ba031b05a784aae97f7cce9884caaae1 100644 (file)
@@ -206,7 +206,6 @@ struct imx_port {
        struct uart_port        port;
        struct timer_list       timer;
        unsigned int            old_status;
-       int                     txirq, rxirq, rtsirq;
        unsigned int            have_rtscts:1;
        unsigned int            dte_mode:1;
        unsigned int            use_irda:1;
@@ -1956,6 +1955,7 @@ static int serial_imx_probe(struct platform_device *pdev)
        void __iomem *base;
        int ret = 0;
        struct resource *res;
+       int txirq, rxirq, rtsirq;
 
        sport = devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL);
        if (!sport)
@@ -1972,15 +1972,16 @@ static int serial_imx_probe(struct platform_device *pdev)
        if (IS_ERR(base))
                return PTR_ERR(base);
 
+       rxirq = platform_get_irq(pdev, 0);
+       txirq = platform_get_irq(pdev, 1);
+       rtsirq = platform_get_irq(pdev, 2);
+
        sport->port.dev = &pdev->dev;
        sport->port.mapbase = res->start;
        sport->port.membase = base;
        sport->port.type = PORT_IMX,
        sport->port.iotype = UPIO_MEM;
-       sport->port.irq = platform_get_irq(pdev, 0);
-       sport->rxirq = platform_get_irq(pdev, 0);
-       sport->txirq = platform_get_irq(pdev, 1);
-       sport->rtsirq = platform_get_irq(pdev, 2);
+       sport->port.irq = rxirq;
        sport->port.fifosize = 32;
        sport->port.ops = &imx_pops;
        sport->port.flags = UPF_BOOT_AUTOCONF;
@@ -2008,27 +2009,27 @@ static int serial_imx_probe(struct platform_device *pdev)
         * Allocate the IRQ(s) i.MX1 has three interrupts whereas later
         * chips only have one interrupt.
         */
-       if (sport->txirq > 0) {
-               ret = devm_request_irq(&pdev->dev, sport->rxirq, imx_rxint, 0,
+       if (txirq > 0) {
+               ret = devm_request_irq(&pdev->dev, rxirq, imx_rxint, 0,
                                       dev_name(&pdev->dev), sport);
                if (ret)
                        return ret;
 
-               ret = devm_request_irq(&pdev->dev, sport->txirq, imx_txint, 0,
+               ret = devm_request_irq(&pdev->dev, txirq, imx_txint, 0,
                                       dev_name(&pdev->dev), sport);
                if (ret)
                        return ret;
 
                /* do not use RTS IRQ on IrDA */
                if (!USE_IRDA(sport)) {
-                       ret = devm_request_irq(&pdev->dev, sport->rtsirq,
+                       ret = devm_request_irq(&pdev->dev, rtsirq,
                                               imx_rtsint, 0,
                                               dev_name(&pdev->dev), sport);
                        if (ret)
                                return ret;
                }
        } else {
-               ret = devm_request_irq(&pdev->dev, sport->port.irq, imx_int, 0,
+               ret = devm_request_irq(&pdev->dev, rxirq, imx_int, 0,
                                       dev_name(&pdev->dev), sport);
                if (ret)
                        return ret;