Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: milbeaut_usio: Fix error handling in probe and remove

devm_clk_get() is used so there is no reason to explicitly call
clk_put() in probe or remove functions. Also remove duplicate assign
for port->membase.

Fixes: ba44dc043004 ("serial: Add Milbeaut serial control")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Tested-by: Sugaya Taichi <sugaya.taichi@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
74cdf8ce 8ef79565

+1 -8
+1 -8
drivers/tty/serial/milbeaut_usio.c
··· 525 525 ret = -ENODEV; 526 526 goto failed; 527 527 } 528 - port->mapbase = res->start; 529 - port->membase = ioremap(res->start, (res->end - res->start + 1)); 530 528 port->membase = devm_ioremap(&pdev->dev, res->start, 531 529 resource_size(res)); 532 530 ··· 546 548 ret = uart_add_one_port(&mlb_usio_uart_driver, port); 547 549 if (ret) { 548 550 dev_err(&pdev->dev, "Adding port failed: %d\n", ret); 549 - goto failed1; 551 + goto failed; 550 552 } 551 553 return 0; 552 554 553 - failed1: 554 - iounmap(port->membase); 555 - 556 555 failed: 557 556 clk_disable_unprepare(clk); 558 - clk_put(clk); 559 557 560 558 return ret; 561 559 } ··· 563 569 564 570 uart_remove_one_port(&mlb_usio_uart_driver, port); 565 571 clk_disable_unprepare(clk); 566 - clk_put(clk); 567 572 568 573 return 0; 569 574 }