Commit 1df21786 authored by Stephen Boyd's avatar Stephen Boyd Committed by Greg Kroah-Hartman

tty: Remove dev_err() usage after platform_get_irq()

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: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-45-swboyd@chromium.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 769d55c5
...@@ -56,10 +56,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev) ...@@ -56,10 +56,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
/* get the interrupt */ /* get the interrupt */
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(&pdev->dev, "irq not found - %i", ret);
return ret; return ret;
}
data->uart.port.irq = ret; data->uart.port.irq = ret;
/* map the main registers */ /* map the main registers */
......
...@@ -106,10 +106,8 @@ static int lpc18xx_serial_probe(struct platform_device *pdev) ...@@ -106,10 +106,8 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
int irq, ret; int irq, ret;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "irq not found");
return irq; return irq;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { if (!res) {
......
...@@ -176,10 +176,8 @@ static int uniphier_uart_probe(struct platform_device *pdev) ...@@ -176,10 +176,8 @@ static int uniphier_uart_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "failed to get IRQ number\n");
return irq; return irq;
}
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
......
...@@ -2718,11 +2718,8 @@ static int sbsa_uart_probe(struct platform_device *pdev) ...@@ -2718,11 +2718,8 @@ static int sbsa_uart_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "cannot obtain irq\n");
return ret; return ret;
}
uap->port.irq = ret; uap->port.irq = ret;
#ifdef CONFIG_ACPI_SPCR_TABLE #ifdef CONFIG_ACPI_SPCR_TABLE
......
...@@ -2385,10 +2385,8 @@ static int lpuart_probe(struct platform_device *pdev) ...@@ -2385,10 +2385,8 @@ static int lpuart_probe(struct platform_device *pdev)
sport->port.type = PORT_LPUART; sport->port.type = PORT_LPUART;
sport->devtype = sdata->devtype; sport->devtype = sdata->devtype;
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(&pdev->dev, "cannot obtain irq\n");
return ret; return ret;
}
sport->port.irq = ret; sport->port.irq = ret;
sport->port.iotype = sdata->iotype; sport->port.iotype = sdata->iotype;
if (lpuart_is_32(sport)) if (lpuart_is_32(sport))
......
...@@ -687,11 +687,8 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev) ...@@ -687,11 +687,8 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev)
p->port.membase = NULL; p->port.membase = NULL;
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(&pdev->dev, "Error getting irq for HS UART port %d\n",
uarts_registered);
return ret; return ret;
}
p->port.irq = ret; p->port.irq = ret;
p->port.iotype = UPIO_MEM32; p->port.iotype = UPIO_MEM32;
......
...@@ -884,10 +884,8 @@ static int mvebu_uart_probe(struct platform_device *pdev) ...@@ -884,10 +884,8 @@ static int mvebu_uart_probe(struct platform_device *pdev)
if (platform_irq_count(pdev) == 1) { if (platform_irq_count(pdev) == 1) {
/* Old bindings: no name on the single unamed UART0 IRQ */ /* Old bindings: no name on the single unamed UART0 IRQ */
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "unable to get UART IRQ\n");
return irq; return irq;
}
mvuart->irq[UART_IRQ_SUM] = irq; mvuart->irq[UART_IRQ_SUM] = irq;
} else { } else {
...@@ -897,18 +895,14 @@ static int mvebu_uart_probe(struct platform_device *pdev) ...@@ -897,18 +895,14 @@ static int mvebu_uart_probe(struct platform_device *pdev)
* uart-sum of UART0 port. * uart-sum of UART0 port.
*/ */
irq = platform_get_irq_byname(pdev, "uart-rx"); irq = platform_get_irq_byname(pdev, "uart-rx");
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "unable to get 'uart-rx' IRQ\n");
return irq; return irq;
}
mvuart->irq[UART_RX_IRQ] = irq; mvuart->irq[UART_RX_IRQ] = irq;
irq = platform_get_irq_byname(pdev, "uart-tx"); irq = platform_get_irq_byname(pdev, "uart-tx");
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "unable to get 'uart-tx' IRQ\n");
return irq; return irq;
}
mvuart->irq[UART_TX_IRQ] = irq; mvuart->irq[UART_TX_IRQ] = irq;
} }
......
...@@ -662,10 +662,8 @@ static int owl_uart_probe(struct platform_device *pdev) ...@@ -662,10 +662,8 @@ static int owl_uart_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "could not get irq\n");
return irq; return irq;
}
if (owl_uart_ports[pdev->id]) { if (owl_uart_ports[pdev->id]) {
dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
......
...@@ -1291,10 +1291,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) ...@@ -1291,10 +1291,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
port->tx_fifo_width = DEF_FIFO_WIDTH_BITS; port->tx_fifo_width = DEF_FIFO_WIDTH_BITS;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "Failed to get IRQ %d\n", irq);
return irq; return irq;
}
uport->irq = irq; uport->irq = irq;
uport->private_data = drv; uport->private_data = drv;
......
...@@ -735,10 +735,8 @@ static int rda_uart_probe(struct platform_device *pdev) ...@@ -735,10 +735,8 @@ static int rda_uart_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "could not get irq\n");
return irq; return irq;
}
if (rda_uart_ports[pdev->id]) { if (rda_uart_ports[pdev->id]) {
dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
......
...@@ -961,7 +961,6 @@ static int sccnxp_probe(struct platform_device *pdev) ...@@ -961,7 +961,6 @@ static int sccnxp_probe(struct platform_device *pdev)
if (!s->poll) { if (!s->poll) {
s->irq = platform_get_irq(pdev, 0); s->irq = platform_get_irq(pdev, 0);
if (s->irq < 0) { if (s->irq < 0) {
dev_err(&pdev->dev, "Missing irq resource data\n");
ret = -ENXIO; ret = -ENXIO;
goto err_out; goto err_out;
} }
......
...@@ -1307,10 +1307,8 @@ static int tegra_uart_probe(struct platform_device *pdev) ...@@ -1307,10 +1307,8 @@ static int tegra_uart_probe(struct platform_device *pdev)
u->iotype = UPIO_MEM32; u->iotype = UPIO_MEM32;
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(&pdev->dev, "Couldn't get IRQ\n");
return ret; return ret;
}
u->irq = ret; u->irq = ret;
u->regshift = 2; u->regshift = 2;
ret = uart_add_one_port(&tegra_uart_driver, u); ret = uart_add_one_port(&tegra_uart_driver, u);
......
...@@ -896,10 +896,8 @@ static int sifive_serial_probe(struct platform_device *pdev) ...@@ -896,10 +896,8 @@ static int sifive_serial_probe(struct platform_device *pdev)
int irq, id, r; int irq, id, r;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "could not acquire interrupt\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, mem); base = devm_ioremap_resource(&pdev->dev, mem);
......
...@@ -1173,10 +1173,8 @@ static int sprd_probe(struct platform_device *pdev) ...@@ -1173,10 +1173,8 @@ static int sprd_probe(struct platform_device *pdev)
up->mapbase = res->start; up->mapbase = res->start;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "not provide irq resource: %d\n", irq);
return irq; return irq;
}
up->irq = irq; up->irq = irq;
/* /*
......
...@@ -928,11 +928,8 @@ static int stm32_init_port(struct stm32_port *stm32port, ...@@ -928,11 +928,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
port->fifosize = stm32port->info->cfg.fifosize; port->fifosize = stm32port->info->cfg.fifosize;
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret <= 0) { if (ret <= 0)
if (ret != -EPROBE_DEFER) return ret ? : -ENODEV;
dev_err(&pdev->dev, "Can't get event IRQ: %d\n", ret);
return ret ? ret : -ENODEV;
}
port->irq = ret; port->irq = ret;
port->rs485_config = stm32_config_rs485; port->rs485_config = stm32_config_rs485;
...@@ -941,14 +938,8 @@ static int stm32_init_port(struct stm32_port *stm32port, ...@@ -941,14 +938,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
if (stm32port->info->cfg.has_wakeup) { if (stm32port->info->cfg.has_wakeup) {
stm32port->wakeirq = platform_get_irq(pdev, 1); stm32port->wakeirq = platform_get_irq(pdev, 1);
if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO) { if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO)
if (stm32port->wakeirq != -EPROBE_DEFER) return stm32port->wakeirq ? : -ENODEV;
dev_err(&pdev->dev,
"Can't get event wake IRQ: %d\n",
stm32port->wakeirq);
return stm32port->wakeirq ? stm32port->wakeirq :
-ENODEV;
}
} }
stm32port->fifoen = stm32port->info->cfg.has_fifo; stm32port->fifoen = stm32port->info->cfg.has_fifo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment