diff options
author | Eugeniy Meshcheryakov <eugen@debian.org> | 2008-07-31 05:03:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-01 15:50:15 -0400 |
commit | 3ab36ab68531ad90648fdeedcaf437f121572ede (patch) | |
tree | 9a61fb71173caff9fdf29a9d3f3626d5c0fa26ef /drivers/char/tty_ldisc.c | |
parent | 84ff7a001270258f71d6ab0d164f351e32c9718a (diff) |
try harder to load tty ldisc driver
Currently function tty_ldisc_get() tries to load an ldisc driver module
only when tty_ldisc_try_get() returns -EAGAIN. This happens only if
module is being unloaded. If ldisc module is not loaded
tty_ldisc_try_get() returns -EINVAL and this case is not handled in
tty_ldisc_get(), so request_module() is not called.
Attached patch fixes this by calling request_module() if
tty_ldisc_try_get() returned any error code.
I discovered this when my UMTS modem stopped working with 2.6.27-rc1
because module ppp_async was not loaded.
Signed-off-by: Eugeniy Meshcheryakov <eugen@debian.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/tty_ldisc.c')
-rw-r--r-- | drivers/char/tty_ldisc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c index 241cbdea65ab..f307f135cbfb 100644 --- a/drivers/char/tty_ldisc.c +++ b/drivers/char/tty_ldisc.c | |||
@@ -169,7 +169,7 @@ static int tty_ldisc_get(int disc, struct tty_ldisc *ld) | |||
169 | if (disc < N_TTY || disc >= NR_LDISCS) | 169 | if (disc < N_TTY || disc >= NR_LDISCS) |
170 | return -EINVAL; | 170 | return -EINVAL; |
171 | err = tty_ldisc_try_get(disc, ld); | 171 | err = tty_ldisc_try_get(disc, ld); |
172 | if (err == -EAGAIN) { | 172 | if (err < 0) { |
173 | request_module("tty-ldisc-%d", disc); | 173 | request_module("tty-ldisc-%d", disc); |
174 | err = tty_ldisc_try_get(disc, ld); | 174 | err = tty_ldisc_try_get(disc, ld); |
175 | } | 175 | } |