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

Configure Feed

Select the types of activity you want to include in your feed.

serial: 8250_aspeed_vuart: Use dev_err_probe() instead of dev_err()

The probe process may generate EPROBE_DEFER. In this case
dev_err_probe() can still record err information. Otherwise
it may pollute logs on that occasion.

This also helps simplifing code and standardizing the error output.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230912165540.402504-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
e8bbaeac 2ff477b7

+7 -7
+7 -7
drivers/tty/serial/8250/8250_aspeed_vuart.c
··· 415 415 static int aspeed_vuart_probe(struct platform_device *pdev) 416 416 { 417 417 struct of_phandle_args sirq_polarity_sense_args; 418 + struct device *dev = &pdev->dev; 418 419 struct uart_8250_port port; 419 420 struct aspeed_vuart *vuart; 420 421 struct device_node *np; ··· 456 455 if (of_property_read_u32(np, "clock-frequency", &clk)) { 457 456 vuart->clk = devm_clk_get(&pdev->dev, NULL); 458 457 if (IS_ERR(vuart->clk)) { 459 - dev_warn(&pdev->dev, 460 - "clk or clock-frequency not defined\n"); 461 - rc = PTR_ERR(vuart->clk); 458 + rc = dev_err_probe(dev, PTR_ERR(vuart->clk), 459 + "clk or clock-frequency not defined\n"); 462 460 goto err_sysfs_remove; 463 461 } 464 462 ··· 533 533 534 534 rc = aspeed_vuart_set_lpc_address(vuart, prop); 535 535 if (rc < 0) { 536 - dev_err(&pdev->dev, "invalid value in aspeed,lpc-io-reg property\n"); 536 + dev_err_probe(dev, rc, "invalid value in aspeed,lpc-io-reg property\n"); 537 537 goto err_clk_disable; 538 538 } 539 539 ··· 545 545 546 546 rc = aspeed_vuart_set_sirq(vuart, sirq[0]); 547 547 if (rc < 0) { 548 - dev_err(&pdev->dev, "invalid sirq number in aspeed,lpc-interrupts property\n"); 548 + dev_err_probe(dev, rc, "invalid sirq number in aspeed,lpc-interrupts property\n"); 549 549 goto err_clk_disable; 550 550 } 551 551 552 552 sirq_polarity = aspeed_vuart_map_irq_polarity(sirq[1]); 553 553 if (sirq_polarity < 0) { 554 - dev_err(&pdev->dev, "invalid sirq polarity in aspeed,lpc-interrupts property\n"); 555 - rc = sirq_polarity; 554 + rc = dev_err_probe(dev, sirq_polarity, 555 + "invalid sirq polarity in aspeed,lpc-interrupts property\n"); 556 556 goto err_clk_disable; 557 557 } 558 558