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_exar: Switch to use dev_err_probe()

Switch to use dev_err_probe() to simplify the error path and
unify a message template.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Parker Newman <pnewman@connecttech.com>
Link: https://lore.kernel.org/r/20240503171917.2921250-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
d72c3018 9b2bff26

+7 -14
+7 -14
drivers/tty/serial/8250/8250_exar.c
··· 889 889 port->port.uartclk = priv->osc_freq; 890 890 891 891 ret = serial8250_pci_setup_port(pcidev, port, 0, offset, 0); 892 - if (ret) { 893 - dev_err(&pcidev->dev, 894 - "failed to setup pci for port %d err: %d\n", idx, ret); 892 + if (ret) 895 893 return ret; 896 - } 897 894 898 895 port->port.private_data = (void *)priv; 899 896 port->port.pm = exar_pm; ··· 1519 1522 maxnr = pci_resource_len(pcidev, bar) >> (board->reg_shift + 3); 1520 1523 1521 1524 nr_ports = exar_get_nr_ports(board, pcidev); 1522 - if (nr_ports == 0) { 1523 - dev_err_probe(&pcidev->dev, -ENODEV, 1524 - "failed to get number of ports\n"); 1525 - return -ENODEV; 1526 - } 1525 + if (nr_ports == 0) 1526 + return dev_err_probe(&pcidev->dev, -ENODEV, "failed to get number of ports\n"); 1527 1527 1528 1528 priv = devm_kzalloc(&pcidev->dev, struct_size(priv, line, nr_ports), GFP_KERNEL); 1529 1529 if (!priv) ··· 1553 1559 for (i = 0; i < nr_ports && i < maxnr; i++) { 1554 1560 rc = board->setup(priv, pcidev, &uart, i); 1555 1561 if (rc) { 1556 - dev_err(&pcidev->dev, "Failed to setup port %u\n", i); 1562 + dev_err_probe(&pcidev->dev, rc, "Failed to setup port %u\n", i); 1557 1563 break; 1558 1564 } 1559 1565 ··· 1562 1568 1563 1569 priv->line[i] = serial8250_register_8250_port(&uart); 1564 1570 if (priv->line[i] < 0) { 1565 - dev_err(&pcidev->dev, 1566 - "Couldn't register serial port %lx, irq %d, type %d, error %d\n", 1567 - uart.port.iobase, uart.port.irq, 1568 - uart.port.iotype, priv->line[i]); 1571 + dev_err_probe(&pcidev->dev, priv->line[i], 1572 + "Couldn't register serial port %lx, type %d, irq %d\n", 1573 + uart.port.iobase, uart.port.iotype, uart.port.irq); 1569 1574 break; 1570 1575 } 1571 1576 }