[PATCH] serial: bfin_uart: Delete an error message for a failed memory allocation in bfin_serial_probe()

From: SF Markus Elfring
Date: Sat Dec 09 2017 - 16:12:04 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 9 Dec 2017 22:05:54 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/tty/serial/bfin_uart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 4755fa696321..558f6ebc4f01 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -1221,11 +1221,9 @@ static int bfin_serial_probe(struct platform_device *pdev)
if (bfin_serial_ports[pdev->id] == NULL) {

uart = kzalloc(sizeof(*uart), GFP_KERNEL);
- if (!uart) {
- dev_err(&pdev->dev,
- "fail to malloc bfin_serial_port\n");
+ if (!uart)
return -ENOMEM;
- }
+
bfin_serial_ports[pdev->id] = uart;

#ifdef CONFIG_EARLY_PRINTK
--
2.15.1