staging: greybus: uart: return tty_alloc_driver() errors

gb_tty_init() maps any tty_alloc_driver() failure to -ENOMEM.
tty_alloc_driver() currently always returns -ENOMEM on failure,
so this does not change behavior in practice. However, returning
PTR_ERR(gb_tty_driver) is more correct and consistent with kernel
conventions, preserving any future error codes the function might
return.

Signed-off-by: Alfie Varghese <alfievarghese22@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/20260714134921.817-1-alfievarghese22@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alfie Varghese
2026-07-17 14:18:36 +02:00
committed by Greg Kroah-Hartman
parent bc5ca34cf5
commit 45b5a83721
+1 -1
View File
@@ -951,7 +951,7 @@ static int gb_tty_init(void)
TTY_DRIVER_DYNAMIC_DEV);
if (IS_ERR(gb_tty_driver)) {
pr_err("Can not allocate tty driver\n");
retval = -ENOMEM;
retval = PTR_ERR(gb_tty_driver);
goto fail_unregister_dev;
}