diff options
Diffstat (limited to 'include/linux/tty_driver.h')
-rw-r--r-- | include/linux/tty_driver.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 5cf685086dd3..6e6dbb7447b6 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -50,6 +50,8 @@ | |||
50 | * Note that tty_shutdown() is not called if ops->shutdown is defined. | 50 | * Note that tty_shutdown() is not called if ops->shutdown is defined. |
51 | * This means one is responsible to take care of calling ops->remove (e.g. | 51 | * This means one is responsible to take care of calling ops->remove (e.g. |
52 | * via tty_driver_remove_tty) and releasing tty->termios. | 52 | * via tty_driver_remove_tty) and releasing tty->termios. |
53 | * Note that this hook may be called from *all* the contexts where one | ||
54 | * uses tty refcounting (e.g. tty_port_tty_get). | ||
53 | * | 55 | * |
54 | * | 56 | * |
55 | * void (*cleanup)(struct tty_struct * tty); | 57 | * void (*cleanup)(struct tty_struct * tty); |
@@ -234,6 +236,7 @@ | |||
234 | * if provided (otherwise EINVAL will be returned). | 236 | * if provided (otherwise EINVAL will be returned). |
235 | */ | 237 | */ |
236 | 238 | ||
239 | #include <linux/export.h> | ||
237 | #include <linux/fs.h> | 240 | #include <linux/fs.h> |
238 | #include <linux/list.h> | 241 | #include <linux/list.h> |
239 | #include <linux/cdev.h> | 242 | #include <linux/cdev.h> |
@@ -298,7 +301,6 @@ struct tty_driver { | |||
298 | int name_base; /* offset of printed name */ | 301 | int name_base; /* offset of printed name */ |
299 | int major; /* major device number */ | 302 | int major; /* major device number */ |
300 | int minor_start; /* start of minor device number */ | 303 | int minor_start; /* start of minor device number */ |
301 | int minor_num; /* number of *possible* devices */ | ||
302 | int num; /* number of devices allocated */ | 304 | int num; /* number of devices allocated */ |
303 | short type; /* type of tty driver */ | 305 | short type; /* type of tty driver */ |
304 | short subtype; /* subtype of tty driver */ | 306 | short subtype; /* subtype of tty driver */ |
@@ -324,7 +326,7 @@ struct tty_driver { | |||
324 | 326 | ||
325 | extern struct list_head tty_drivers; | 327 | extern struct list_head tty_drivers; |
326 | 328 | ||
327 | extern struct tty_driver *alloc_tty_driver(int lines); | 329 | extern struct tty_driver *__alloc_tty_driver(int lines, struct module *owner); |
328 | extern void put_tty_driver(struct tty_driver *driver); | 330 | extern void put_tty_driver(struct tty_driver *driver); |
329 | extern void tty_set_operations(struct tty_driver *driver, | 331 | extern void tty_set_operations(struct tty_driver *driver, |
330 | const struct tty_operations *op); | 332 | const struct tty_operations *op); |
@@ -332,6 +334,8 @@ extern struct tty_driver *tty_find_polling_driver(char *name, int *line); | |||
332 | 334 | ||
333 | extern void tty_driver_kref_put(struct tty_driver *driver); | 335 | extern void tty_driver_kref_put(struct tty_driver *driver); |
334 | 336 | ||
337 | #define alloc_tty_driver(lines) __alloc_tty_driver(lines, THIS_MODULE) | ||
338 | |||
335 | static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | 339 | static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) |
336 | { | 340 | { |
337 | kref_get(&d->kref); | 341 | kref_get(&d->kref); |