From: Peter Hurley Date: Mon, 11 Jan 2016 06:40:59 +0000 (-0800) Subject: tty: Fix comments for tty_ldisc_get() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c0cc1c5d6b67289ea2e77346e0161506b0d4f393;p=linux-beck.git tty: Fix comments for tty_ldisc_get() tty_ldisc_get() returns ERR_PTR() values if unsuccessful, not NULL; fix function header documentation. Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index b2e8210639dd..4008f5f65345 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -140,9 +140,16 @@ static void put_ldops(struct tty_ldisc_ops *ldops) * @disc: ldisc number * * Takes a reference to a line discipline. Deals with refcounts and - * module locking counts. Returns NULL if the discipline is not available. - * Returns a pointer to the discipline and bumps the ref count if it is - * available + * module locking counts. + * + * Returns: -EINVAL if the discipline index is not [N_TTY..NR_LDISCS] or + * if the discipline is not registered + * -EAGAIN if request_module() failed to load or register the + * the discipline + * -ENOMEM if allocation failure + * + * Otherwise, returns a pointer to the discipline and bumps the + * ref count * * Locking: * takes tty_ldiscs_lock to guard against ldisc races