summaryrefslogtreecommitdiffstats
path: root/drivers/tty/rpmsg_tty.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-10-25 16:51:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-26 19:19:41 +0200
commit8673ef7bd96dd75ed308cb71d48a292eaa1b72fa (patch)
tree13647d6051c85d9574ea139ceb04a974a05e7c87 /drivers/tty/rpmsg_tty.c
parent408a507996e4c2ba943bc9b28be8bbb8424410b1 (diff)
downloadlinux-8673ef7bd96dd75ed308cb71d48a292eaa1b72fa.tar.bz2
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>
Diffstat (limited to 'drivers/tty/rpmsg_tty.c')
-rw-r--r--drivers/tty/rpmsg_tty.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/tty/rpmsg_tty.c b/drivers/tty/rpmsg_tty.c
index fc5d33dc4cb8..d172dd331bc9 100644
--- a/drivers/tty/rpmsg_tty.c
+++ b/drivers/tty/rpmsg_tty.c
@@ -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,9 +162,8 @@ 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);
- goto err_destroy;
+ ret = dev_err_probe(dev, PTR_ERR(tty_dev), "Failed to register tty port\n");
+ goto err_destroy;
}
cport->rpdev = rpdev;