tty: rpmsg: Use dev_err_probe() in ->probe()

It's fine to use dev_err_probe() in ->probe() even if we know
it won't be deferred.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211025135148.53944-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Andy Shevchenko 2021-10-25 16:51:46 +03:00 committed by Greg Kroah-Hartman
parent 408a507996
commit 8673ef7bd9

View File

@ -153,10 +153,8 @@ static int rpmsg_tty_probe(struct rpmsg_device *rpdev)
int ret;
cport = rpmsg_tty_alloc_cport();
if (IS_ERR(cport)) {
dev_err(dev, "Failed to alloc tty port\n");
return PTR_ERR(cport);
}
if (IS_ERR(cport))
return dev_err_probe(dev, PTR_ERR(cport), "Failed to alloc tty port\n");
tty_port_init(&cport->port);
cport->port.ops = &rpmsg_tty_port_ops;
@ -164,8 +162,7 @@ static int rpmsg_tty_probe(struct rpmsg_device *rpdev)
tty_dev = tty_port_register_device(&cport->port, rpmsg_tty_driver,
cport->id, dev);
if (IS_ERR(tty_dev)) {
dev_err(dev, "Failed to register tty port\n");
ret = PTR_ERR(tty_dev);
ret = dev_err_probe(dev, PTR_ERR(tty_dev), "Failed to register tty port\n");
goto err_destroy;
}