]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
tty: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:44 +0000 (11:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Sep 2019 10:43:49 +0000 (12:43 +0200)
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-45-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 files changed:
drivers/tty/serial/8250/8250_bcm2835aux.c
drivers/tty/serial/8250/8250_lpc18xx.c
drivers/tty/serial/8250/8250_uniphier.c
drivers/tty/serial/amba-pl011.c
drivers/tty/serial/fsl_lpuart.c
drivers/tty/serial/lpc32xx_hs.c
drivers/tty/serial/mvebu-uart.c
drivers/tty/serial/owl-uart.c
drivers/tty/serial/qcom_geni_serial.c
drivers/tty/serial/rda-uart.c
drivers/tty/serial/sccnxp.c
drivers/tty/serial/serial-tegra.c
drivers/tty/serial/sifive.c
drivers/tty/serial/sprd_serial.c
drivers/tty/serial/stm32-usart.c

index bd53661103eb2b5b6331d147b25e19eb69e1b227..8ce700c1a7fce402f149457ad04bdda1a2b19d20 100644 (file)
@@ -56,10 +56,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
 
        /* get the interrupt */
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "irq not found - %i", ret);
+       if (ret < 0)
                return ret;
-       }
        data->uart.port.irq = ret;
 
        /* map the main registers */
index eddf119374e11ba5b7d8bc93ab6bb0f38b69690a..570e25d6f37e3f4ec008201fe92cf2bb3c4d1414 100644 (file)
@@ -106,10 +106,8 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
        int irq, ret;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "irq not found");
+       if (irq < 0)
                return irq;
-       }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {
index 164ba133437af69176ce0ca8316c7d572a0ff99a..e0b73a5402db71048565aa809aca25ef8559e381 100644 (file)
@@ -176,10 +176,8 @@ static int uniphier_uart_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "failed to get IRQ number\n");
+       if (irq < 0)
                return irq;
-       }
 
        priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
index 5921a33b2a0766e7f6549d9cae36779309e0b6fb..3a7d1a66f79c58184f5b744427d60fc8d6ce5481 100644 (file)
@@ -2718,11 +2718,8 @@ static int sbsa_uart_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               if (ret != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "cannot obtain irq\n");
+       if (ret < 0)
                return ret;
-       }
        uap->port.irq   = ret;
 
 #ifdef CONFIG_ACPI_SPCR_TABLE
index 8cf10d12947f405cdc2b1141e6b9876f5eb345b6..0e09e6dc5ccbe95391d203025465cda45bc29a07 100644 (file)
@@ -2385,10 +2385,8 @@ static int lpuart_probe(struct platform_device *pdev)
        sport->port.type = PORT_LPUART;
        sport->devtype = sdata->devtype;
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "cannot obtain irq\n");
+       if (ret < 0)
                return ret;
-       }
        sport->port.irq = ret;
        sport->port.iotype = sdata->iotype;
        if (lpuart_is_32(sport))
index f4e27d0ad9472a016d33845ad95d41f8e7b8594c..7c67e3afbac70804e46513a90b0c8342b7a47b18 100644 (file)
@@ -687,11 +687,8 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev)
        p->port.membase = NULL;
 
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "Error getting irq for HS UART port %d\n",
-                       uarts_registered);
+       if (ret < 0)
                return ret;
-       }
        p->port.irq = ret;
 
        p->port.iotype = UPIO_MEM32;
index 7e7b1559fa3695406ae80edda49f0f1f7634dc9a..c12a12556339f5c7b3b26aa4e5fa4efe04d0ce20 100644 (file)
@@ -884,10 +884,8 @@ static int mvebu_uart_probe(struct platform_device *pdev)
        if (platform_irq_count(pdev) == 1) {
                /* Old bindings: no name on the single unamed UART0 IRQ */
                irq = platform_get_irq(pdev, 0);
-               if (irq < 0) {
-                       dev_err(&pdev->dev, "unable to get UART IRQ\n");
+               if (irq < 0)
                        return irq;
-               }
 
                mvuart->irq[UART_IRQ_SUM] = irq;
        } else {
@@ -897,18 +895,14 @@ static int mvebu_uart_probe(struct platform_device *pdev)
                 * uart-sum of UART0 port.
                 */
                irq = platform_get_irq_byname(pdev, "uart-rx");
-               if (irq < 0) {
-                       dev_err(&pdev->dev, "unable to get 'uart-rx' IRQ\n");
+               if (irq < 0)
                        return irq;
-               }
 
                mvuart->irq[UART_RX_IRQ] = irq;
 
                irq = platform_get_irq_byname(pdev, "uart-tx");
-               if (irq < 0) {
-                       dev_err(&pdev->dev, "unable to get 'uart-tx' IRQ\n");
+               if (irq < 0)
                        return irq;
-               }
 
                mvuart->irq[UART_TX_IRQ] = irq;
        }
index 29a6dc6a8d23c7350fb77a71da9949d9c5b659bf..03963af77b15b88ab6e19e38fa7af25fc2f40407 100644 (file)
@@ -662,10 +662,8 @@ static int owl_uart_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "could not get irq\n");
+       if (irq < 0)
                return irq;
-       }
 
        if (owl_uart_ports[pdev->id]) {
                dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
index 35e5f9c5d5bed48274363343366c8bd76395c500..f879710e23f1cb3245d21b7761770c8d2546d25c 100644 (file)
@@ -1291,10 +1291,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
        port->tx_fifo_width = DEF_FIFO_WIDTH_BITS;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "Failed to get IRQ %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
        uport->irq = irq;
 
        uport->private_data = drv;
index 284623eefaeba2aeba275b08193ffaa8738905fa..c1b0d7662ef9eb177a40b832204c264f95edb2b8 100644 (file)
@@ -735,10 +735,8 @@ static int rda_uart_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "could not get irq\n");
+       if (irq < 0)
                return irq;
-       }
 
        if (rda_uart_ports[pdev->id]) {
                dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
index 68a24a14f6b72ce878c7dd6cc4922ea142ed6a12..d2b77aae42ae13d14ceac232e4c438fb94b9c703 100644 (file)
@@ -961,7 +961,6 @@ static int sccnxp_probe(struct platform_device *pdev)
        if (!s->poll) {
                s->irq = platform_get_irq(pdev, 0);
                if (s->irq < 0) {
-                       dev_err(&pdev->dev, "Missing irq resource data\n");
                        ret = -ENXIO;
                        goto err_out;
                }
index d5269aaaf9b238235239be10c2440d8af70bb23d..76ffbc7826aeb5d0acd9a5ed99c01b9dd669f34b 100644 (file)
@@ -1307,10 +1307,8 @@ static int tegra_uart_probe(struct platform_device *pdev)
 
        u->iotype = UPIO_MEM32;
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "Couldn't get IRQ\n");
+       if (ret < 0)
                return ret;
-       }
        u->irq = ret;
        u->regshift = 2;
        ret = uart_add_one_port(&tegra_uart_driver, u);
index be4687814353be90afe1428b679c8990751be7db..d5f81b98e4d754727e4dd6c09b345f93fa077f49 100644 (file)
@@ -896,10 +896,8 @@ static int sifive_serial_probe(struct platform_device *pdev)
        int irq, id, r;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "could not acquire interrupt\n");
+       if (irq < 0)
                return -EPROBE_DEFER;
-       }
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        base = devm_ioremap_resource(&pdev->dev, mem);
index 73d71a4e6c0cac6b74fd4136d9dcb22d6552e366..284709f618318767a2599a8a9c8488bebd886b50 100644 (file)
@@ -1173,10 +1173,8 @@ static int sprd_probe(struct platform_device *pdev)
        up->mapbase = res->start;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "not provide irq resource: %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
        up->irq = irq;
 
        /*
index 45dbc42e15b9074e9f155b10ce403d331f633931..df90747ee3a81bd6733a7257ea722f6deb41c3f6 100644 (file)
@@ -928,11 +928,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
        port->fifosize  = stm32port->info->cfg.fifosize;
 
        ret = platform_get_irq(pdev, 0);
-       if (ret <= 0) {
-               if (ret != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "Can't get event IRQ: %d\n", ret);
-               return ret ? ret : -ENODEV;
-       }
+       if (ret <= 0)
+               return ret ? : -ENODEV;
        port->irq = ret;
 
        port->rs485_config = stm32_config_rs485;
@@ -941,14 +938,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
 
        if (stm32port->info->cfg.has_wakeup) {
                stm32port->wakeirq = platform_get_irq(pdev, 1);
-               if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO) {
-                       if (stm32port->wakeirq != -EPROBE_DEFER)
-                               dev_err(&pdev->dev,
-                                       "Can't get event wake IRQ: %d\n",
-                                       stm32port->wakeirq);
-                       return stm32port->wakeirq ? stm32port->wakeirq :
-                               -ENODEV;
-               }
+               if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO)
+                       return stm32port->wakeirq ? : -ENODEV;
        }
 
        stm32port->fifoen = stm32port->info->cfg.has_fifo;