aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <swboyd@chromium.org>2019-07-30 14:15:44 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-04 06:43:49 -0400
commit1df217868178bde7f4405255416de9547d16c6e8 (patch)
tree93dcf66d90acc8b7863d351e62706944800f1093
parent769d55c523f7ba572d7e7aefa17106e5deff66e0 (diff)
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: 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>
-rw-r--r--drivers/tty/serial/8250/8250_bcm2835aux.c4
-rw-r--r--drivers/tty/serial/8250/8250_lpc18xx.c4
-rw-r--r--drivers/tty/serial/8250/8250_uniphier.c4
-rw-r--r--drivers/tty/serial/amba-pl011.c5
-rw-r--r--drivers/tty/serial/fsl_lpuart.c4
-rw-r--r--drivers/tty/serial/lpc32xx_hs.c5
-rw-r--r--drivers/tty/serial/mvebu-uart.c12
-rw-r--r--drivers/tty/serial/owl-uart.c4
-rw-r--r--drivers/tty/serial/qcom_geni_serial.c4
-rw-r--r--drivers/tty/serial/rda-uart.c4
-rw-r--r--drivers/tty/serial/sccnxp.c1
-rw-r--r--drivers/tty/serial/serial-tegra.c4
-rw-r--r--drivers/tty/serial/sifive.c4
-rw-r--r--drivers/tty/serial/sprd_serial.c4
-rw-r--r--drivers/tty/serial/stm32-usart.c17
15 files changed, 19 insertions, 61 deletions
diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index bd53661103eb..8ce700c1a7fc 100644
--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -56,10 +56,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
56 56
57 /* get the interrupt */ 57 /* get the interrupt */
58 ret = platform_get_irq(pdev, 0); 58 ret = platform_get_irq(pdev, 0);
59 if (ret < 0) { 59 if (ret < 0)
60 dev_err(&pdev->dev, "irq not found - %i", ret);
61 return ret; 60 return ret;
62 }
63 data->uart.port.irq = ret; 61 data->uart.port.irq = ret;
64 62
65 /* map the main registers */ 63 /* map the main registers */
diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c
index eddf119374e1..570e25d6f37e 100644
--- a/drivers/tty/serial/8250/8250_lpc18xx.c
+++ b/drivers/tty/serial/8250/8250_lpc18xx.c
@@ -106,10 +106,8 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
106 int irq, ret; 106 int irq, ret;
107 107
108 irq = platform_get_irq(pdev, 0); 108 irq = platform_get_irq(pdev, 0);
109 if (irq < 0) { 109 if (irq < 0)
110 dev_err(&pdev->dev, "irq not found");
111 return irq; 110 return irq;
112 }
113 111
114 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 112 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
115 if (!res) { 113 if (!res) {
diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c
index 164ba133437a..e0b73a5402db 100644
--- a/drivers/tty/serial/8250/8250_uniphier.c
+++ b/drivers/tty/serial/8250/8250_uniphier.c
@@ -176,10 +176,8 @@ static int uniphier_uart_probe(struct platform_device *pdev)
176 return -ENOMEM; 176 return -ENOMEM;
177 177
178 irq = platform_get_irq(pdev, 0); 178 irq = platform_get_irq(pdev, 0);
179 if (irq < 0) { 179 if (irq < 0)
180 dev_err(dev, "failed to get IRQ number\n");
181 return irq; 180 return irq;
182 }
183 181
184 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 182 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
185 if (!priv) 183 if (!priv)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 5921a33b2a07..3a7d1a66f79c 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2718,11 +2718,8 @@ static int sbsa_uart_probe(struct platform_device *pdev)
2718 return -ENOMEM; 2718 return -ENOMEM;
2719 2719
2720 ret = platform_get_irq(pdev, 0); 2720 ret = platform_get_irq(pdev, 0);
2721 if (ret < 0) { 2721 if (ret < 0)
2722 if (ret != -EPROBE_DEFER)
2723 dev_err(&pdev->dev, "cannot obtain irq\n");
2724 return ret; 2722 return ret;
2725 }
2726 uap->port.irq = ret; 2723 uap->port.irq = ret;
2727 2724
2728#ifdef CONFIG_ACPI_SPCR_TABLE 2725#ifdef CONFIG_ACPI_SPCR_TABLE
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 8cf10d12947f..0e09e6dc5ccb 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2385,10 +2385,8 @@ static int lpuart_probe(struct platform_device *pdev)
2385 sport->port.type = PORT_LPUART; 2385 sport->port.type = PORT_LPUART;
2386 sport->devtype = sdata->devtype; 2386 sport->devtype = sdata->devtype;
2387 ret = platform_get_irq(pdev, 0); 2387 ret = platform_get_irq(pdev, 0);
2388 if (ret < 0) { 2388 if (ret < 0)
2389 dev_err(&pdev->dev, "cannot obtain irq\n");
2390 return ret; 2389 return ret;
2391 }
2392 sport->port.irq = ret; 2390 sport->port.irq = ret;
2393 sport->port.iotype = sdata->iotype; 2391 sport->port.iotype = sdata->iotype;
2394 if (lpuart_is_32(sport)) 2392 if (lpuart_is_32(sport))
diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index f4e27d0ad947..7c67e3afbac7 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -687,11 +687,8 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev)
687 p->port.membase = NULL; 687 p->port.membase = NULL;
688 688
689 ret = platform_get_irq(pdev, 0); 689 ret = platform_get_irq(pdev, 0);
690 if (ret < 0) { 690 if (ret < 0)
691 dev_err(&pdev->dev, "Error getting irq for HS UART port %d\n",
692 uarts_registered);
693 return ret; 691 return ret;
694 }
695 p->port.irq = ret; 692 p->port.irq = ret;
696 693
697 p->port.iotype = UPIO_MEM32; 694 p->port.iotype = UPIO_MEM32;
diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index 7e7b1559fa36..c12a12556339 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -884,10 +884,8 @@ static int mvebu_uart_probe(struct platform_device *pdev)
884 if (platform_irq_count(pdev) == 1) { 884 if (platform_irq_count(pdev) == 1) {
885 /* Old bindings: no name on the single unamed UART0 IRQ */ 885 /* Old bindings: no name on the single unamed UART0 IRQ */
886 irq = platform_get_irq(pdev, 0); 886 irq = platform_get_irq(pdev, 0);
887 if (irq < 0) { 887 if (irq < 0)
888 dev_err(&pdev->dev, "unable to get UART IRQ\n");
889 return irq; 888 return irq;
890 }
891 889
892 mvuart->irq[UART_IRQ_SUM] = irq; 890 mvuart->irq[UART_IRQ_SUM] = irq;
893 } else { 891 } else {
@@ -897,18 +895,14 @@ static int mvebu_uart_probe(struct platform_device *pdev)
897 * uart-sum of UART0 port. 895 * uart-sum of UART0 port.
898 */ 896 */
899 irq = platform_get_irq_byname(pdev, "uart-rx"); 897 irq = platform_get_irq_byname(pdev, "uart-rx");
900 if (irq < 0) { 898 if (irq < 0)
901 dev_err(&pdev->dev, "unable to get 'uart-rx' IRQ\n");
902 return irq; 899 return irq;
903 }
904 900
905 mvuart->irq[UART_RX_IRQ] = irq; 901 mvuart->irq[UART_RX_IRQ] = irq;
906 902
907 irq = platform_get_irq_byname(pdev, "uart-tx"); 903 irq = platform_get_irq_byname(pdev, "uart-tx");
908 if (irq < 0) { 904 if (irq < 0)
909 dev_err(&pdev->dev, "unable to get 'uart-tx' IRQ\n");
910 return irq; 905 return irq;
911 }
912 906
913 mvuart->irq[UART_TX_IRQ] = irq; 907 mvuart->irq[UART_TX_IRQ] = irq;
914 } 908 }
diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c
index 29a6dc6a8d23..03963af77b15 100644
--- a/drivers/tty/serial/owl-uart.c
+++ b/drivers/tty/serial/owl-uart.c
@@ -662,10 +662,8 @@ static int owl_uart_probe(struct platform_device *pdev)
662 } 662 }
663 663
664 irq = platform_get_irq(pdev, 0); 664 irq = platform_get_irq(pdev, 0);
665 if (irq < 0) { 665 if (irq < 0)
666 dev_err(&pdev->dev, "could not get irq\n");
667 return irq; 666 return irq;
668 }
669 667
670 if (owl_uart_ports[pdev->id]) { 668 if (owl_uart_ports[pdev->id]) {
671 dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); 669 dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 35e5f9c5d5be..f879710e23f1 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1291,10 +1291,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
1291 port->tx_fifo_width = DEF_FIFO_WIDTH_BITS; 1291 port->tx_fifo_width = DEF_FIFO_WIDTH_BITS;
1292 1292
1293 irq = platform_get_irq(pdev, 0); 1293 irq = platform_get_irq(pdev, 0);
1294 if (irq < 0) { 1294 if (irq < 0)
1295 dev_err(&pdev->dev, "Failed to get IRQ %d\n", irq);
1296 return irq; 1295 return irq;
1297 }
1298 uport->irq = irq; 1296 uport->irq = irq;
1299 1297
1300 uport->private_data = drv; 1298 uport->private_data = drv;
diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c
index 284623eefaeb..c1b0d7662ef9 100644
--- a/drivers/tty/serial/rda-uart.c
+++ b/drivers/tty/serial/rda-uart.c
@@ -735,10 +735,8 @@ static int rda_uart_probe(struct platform_device *pdev)
735 } 735 }
736 736
737 irq = platform_get_irq(pdev, 0); 737 irq = platform_get_irq(pdev, 0);
738 if (irq < 0) { 738 if (irq < 0)
739 dev_err(&pdev->dev, "could not get irq\n");
740 return irq; 739 return irq;
741 }
742 740
743 if (rda_uart_ports[pdev->id]) { 741 if (rda_uart_ports[pdev->id]) {
744 dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); 742 dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 68a24a14f6b7..d2b77aae42ae 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -961,7 +961,6 @@ static int sccnxp_probe(struct platform_device *pdev)
961 if (!s->poll) { 961 if (!s->poll) {
962 s->irq = platform_get_irq(pdev, 0); 962 s->irq = platform_get_irq(pdev, 0);
963 if (s->irq < 0) { 963 if (s->irq < 0) {
964 dev_err(&pdev->dev, "Missing irq resource data\n");
965 ret = -ENXIO; 964 ret = -ENXIO;
966 goto err_out; 965 goto err_out;
967 } 966 }
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index d5269aaaf9b2..76ffbc7826ae 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -1307,10 +1307,8 @@ static int tegra_uart_probe(struct platform_device *pdev)
1307 1307
1308 u->iotype = UPIO_MEM32; 1308 u->iotype = UPIO_MEM32;
1309 ret = platform_get_irq(pdev, 0); 1309 ret = platform_get_irq(pdev, 0);
1310 if (ret < 0) { 1310 if (ret < 0)
1311 dev_err(&pdev->dev, "Couldn't get IRQ\n");
1312 return ret; 1311 return ret;
1313 }
1314 u->irq = ret; 1312 u->irq = ret;
1315 u->regshift = 2; 1313 u->regshift = 2;
1316 ret = uart_add_one_port(&tegra_uart_driver, u); 1314 ret = uart_add_one_port(&tegra_uart_driver, u);
diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
index be4687814353..d5f81b98e4d7 100644
--- a/drivers/tty/serial/sifive.c
+++ b/drivers/tty/serial/sifive.c
@@ -896,10 +896,8 @@ static int sifive_serial_probe(struct platform_device *pdev)
896 int irq, id, r; 896 int irq, id, r;
897 897
898 irq = platform_get_irq(pdev, 0); 898 irq = platform_get_irq(pdev, 0);
899 if (irq < 0) { 899 if (irq < 0)
900 dev_err(&pdev->dev, "could not acquire interrupt\n");
901 return -EPROBE_DEFER; 900 return -EPROBE_DEFER;
902 }
903 901
904 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 902 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
905 base = devm_ioremap_resource(&pdev->dev, mem); 903 base = devm_ioremap_resource(&pdev->dev, mem);
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index 73d71a4e6c0c..284709f61831 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -1173,10 +1173,8 @@ static int sprd_probe(struct platform_device *pdev)
1173 up->mapbase = res->start; 1173 up->mapbase = res->start;
1174 1174
1175 irq = platform_get_irq(pdev, 0); 1175 irq = platform_get_irq(pdev, 0);
1176 if (irq < 0) { 1176 if (irq < 0)
1177 dev_err(&pdev->dev, "not provide irq resource: %d\n", irq);
1178 return irq; 1177 return irq;
1179 }
1180 up->irq = irq; 1178 up->irq = irq;
1181 1179
1182 /* 1180 /*
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 45dbc42e15b9..df90747ee3a8 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -928,11 +928,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
928 port->fifosize = stm32port->info->cfg.fifosize; 928 port->fifosize = stm32port->info->cfg.fifosize;
929 929
930 ret = platform_get_irq(pdev, 0); 930 ret = platform_get_irq(pdev, 0);
931 if (ret <= 0) { 931 if (ret <= 0)
932 if (ret != -EPROBE_DEFER) 932 return ret ? : -ENODEV;
933 dev_err(&pdev->dev, "Can't get event IRQ: %d\n", ret);
934 return ret ? ret : -ENODEV;
935 }
936 port->irq = ret; 933 port->irq = ret;
937 934
938 port->rs485_config = stm32_config_rs485; 935 port->rs485_config = stm32_config_rs485;
@@ -941,14 +938,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
941 938
942 if (stm32port->info->cfg.has_wakeup) { 939 if (stm32port->info->cfg.has_wakeup) {
943 stm32port->wakeirq = platform_get_irq(pdev, 1); 940 stm32port->wakeirq = platform_get_irq(pdev, 1);
944 if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO) { 941 if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO)
945 if (stm32port->wakeirq != -EPROBE_DEFER) 942 return stm32port->wakeirq ? : -ENODEV;
946 dev_err(&pdev->dev,
947 "Can't get event wake IRQ: %d\n",
948 stm32port->wakeirq);
949 return stm32port->wakeirq ? stm32port->wakeirq :
950 -ENODEV;
951 }
952 } 943 }
953 944
954 stm32port->fifoen = stm32port->info->cfg.has_fifo; 945 stm32port->fifoen = stm32port->info->cfg.has_fifo;