mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
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:
parent
bc5ca34cf5
commit
45b5a83721
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user