Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4229
b: refs/heads/master
c: 7805b1b
h: refs/heads/master
i:
  4227: ac13c87
v: v3
  • Loading branch information
Milton Miller authored and Linus Torvalds committed Jul 8, 2005
1 parent c4419a4 commit ed31919
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64e4da57964c03da9a03087a398cade81b7bb496
refs/heads/master: 7805b1b29ffdd252dfef36aa28d7bda70cd586d3
18 changes: 18 additions & 0 deletions trunk/drivers/char/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,21 @@ void hvc_console_print(struct console *co, const char *b, unsigned count)

static struct tty_driver *hvc_console_device(struct console *c, int *index)
{
if (vtermnos[c->index] == -1)
return NULL;

*index = c->index;
return hvc_driver;
}

static int __init hvc_console_setup(struct console *co, char *options)
{
if (co->index < 0 || co->index >= MAX_NR_HVC_CONSOLES)
return -ENODEV;

if (vtermnos[co->index] == -1)
return -ENODEV;

return 0;
}

Expand Down Expand Up @@ -227,12 +236,21 @@ console_initcall(hvc_console_init);
*/
int hvc_instantiate(uint32_t vtermno, int index)
{
struct hvc_struct *hp;

if (index < 0 || index >= MAX_NR_HVC_CONSOLES)
return -1;

if (vtermnos[index] != -1)
return -1;

/* make sure no no tty has been registerd in this index */
hp = hvc_get_by_index(index);
if (hp) {
kobject_put(&hp->kobj);
return -1;
}

vtermnos[index] = vtermno;

/* reserve all indices upto and including this index */
Expand Down

0 comments on commit ed31919

Please sign in to comment.