diff options
author | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
commit | 57cad8084e0837e0f2c97da789ec9b3f36809be9 (patch) | |
tree | e9c790afb4286f78cb08d9664f58baa7e876fe55 /arch/um/drivers/tty.c | |
parent | cb18bd40030c879cd93fef02fd579f74dbab473d (diff) | |
parent | 49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff) |
Merge branch 'merge'
Diffstat (limited to 'arch/um/drivers/tty.c')
-rw-r--r-- | arch/um/drivers/tty.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/arch/um/drivers/tty.c b/arch/um/drivers/tty.c index 94c9265a4f2c..9f70edf5d8ef 100644 --- a/arch/um/drivers/tty.c +++ b/arch/um/drivers/tty.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
@@ -25,17 +25,17 @@ static void *tty_chan_init(char *str, int device, struct chan_opts *opts) | |||
25 | if(*str != ':'){ | 25 | if(*str != ':'){ |
26 | printk("tty_init : channel type 'tty' must specify " | 26 | printk("tty_init : channel type 'tty' must specify " |
27 | "a device\n"); | 27 | "a device\n"); |
28 | return(NULL); | 28 | return NULL; |
29 | } | 29 | } |
30 | str++; | 30 | str++; |
31 | 31 | ||
32 | data = um_kmalloc(sizeof(*data)); | 32 | data = um_kmalloc(sizeof(*data)); |
33 | if(data == NULL) | 33 | if(data == NULL) |
34 | return(NULL); | 34 | return NULL; |
35 | *data = ((struct tty_chan) { .dev = str, | 35 | *data = ((struct tty_chan) { .dev = str, |
36 | .raw = opts->raw }); | 36 | .raw = opts->raw }); |
37 | 37 | ||
38 | return(data); | 38 | return data; |
39 | } | 39 | } |
40 | 40 | ||
41 | static int tty_open(int input, int output, int primary, void *d, | 41 | static int tty_open(int input, int output, int primary, void *d, |
@@ -45,19 +45,21 @@ static int tty_open(int input, int output, int primary, void *d, | |||
45 | int fd, err; | 45 | int fd, err; |
46 | 46 | ||
47 | fd = os_open_file(data->dev, of_set_rw(OPENFLAGS(), input, output), 0); | 47 | fd = os_open_file(data->dev, of_set_rw(OPENFLAGS(), input, output), 0); |
48 | if(fd < 0) return(fd); | 48 | if(fd < 0) |
49 | return fd; | ||
50 | |||
49 | if(data->raw){ | 51 | if(data->raw){ |
50 | CATCH_EINTR(err = tcgetattr(fd, &data->tt)); | 52 | CATCH_EINTR(err = tcgetattr(fd, &data->tt)); |
51 | if(err) | 53 | if(err) |
52 | return(err); | 54 | return err; |
53 | 55 | ||
54 | err = raw(fd); | 56 | err = raw(fd); |
55 | if(err) | 57 | if(err) |
56 | return(err); | 58 | return err; |
57 | } | 59 | } |
58 | 60 | ||
59 | *dev_out = data->dev; | 61 | *dev_out = data->dev; |
60 | return(fd); | 62 | return fd; |
61 | } | 63 | } |
62 | 64 | ||
63 | struct chan_ops tty_ops = { | 65 | struct chan_ops tty_ops = { |
@@ -72,14 +74,3 @@ struct chan_ops tty_ops = { | |||
72 | .free = generic_free, | 74 | .free = generic_free, |
73 | .winch = 0, | 75 | .winch = 0, |
74 | }; | 76 | }; |
75 | |||
76 | /* | ||
77 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
78 | * Emacs will notice this stuff at the end of the file and automatically | ||
79 | * adjust the settings for this buffer only. This must remain at the end | ||
80 | * of the file. | ||
81 | * --------------------------------------------------------------------------- | ||
82 | * Local variables: | ||
83 | * c-file-style: "linux" | ||
84 | * End: | ||
85 | */ | ||