Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133459
b: refs/heads/master
c: 4995f8e
h: refs/heads/master
i:
  133457: 7e36173
  133455: 94ec816
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Mar 24, 2009
1 parent 12f3486 commit 168c75c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce21c7bcd796fc4f45d48781b7e85f493cc55ee5
refs/heads/master: 4995f8ef9d3aac72745e12419d7fbaa8d01b1d81
16 changes: 8 additions & 8 deletions trunk/drivers/char/vc_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,18 +479,18 @@ static const struct file_operations vcs_fops = {

static struct class *vc_class;

void vcs_make_sysfs(struct tty_struct *tty)
void vcs_make_sysfs(int index)
{
device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1), NULL,
"vcs%u", tty->index + 1);
device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129), NULL,
"vcsa%u", tty->index + 1);
device_create(vc_class, NULL, MKDEV(VCS_MAJOR, index + 1), NULL,
"vcs%u", index + 1);
device_create(vc_class, NULL, MKDEV(VCS_MAJOR, index + 129), NULL,
"vcsa%u", index + 1);
}

void vcs_remove_sysfs(struct tty_struct *tty)
void vcs_remove_sysfs(int index)
{
device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 1));
device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 129));
device_destroy(vc_class, MKDEV(VCS_MAJOR, index + 1));
device_destroy(vc_class, MKDEV(VCS_MAJOR, index + 129));
}

int __init vcs_init(void)
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/char/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
}
vc->vc_kmalloced = 1;
vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
vcs_make_sysfs(currcons);
atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
}
return 0;
Expand Down Expand Up @@ -987,7 +988,9 @@ void vc_deallocate(unsigned int currcons)
if (vc_cons_allocated(currcons)) {
struct vc_data *vc = vc_cons[currcons].d;
struct vt_notifier_param param = { .vc = vc };

atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, &param);
vcs_remove_sysfs(currcons);
vc->vc_sw->con_deinit(vc);
put_pid(vc->vt_pid);
module_put(vc->vc_sw->owner);
Expand Down Expand Up @@ -2775,7 +2778,6 @@ static int con_open(struct tty_struct *tty, struct file *filp)
tty->termios->c_iflag |= IUTF8;
else
tty->termios->c_iflag &= ~IUTF8;
vcs_make_sysfs(tty);
release_console_sem();
return ret;
}
Expand All @@ -2795,7 +2797,6 @@ static void con_shutdown(struct tty_struct *tty)
BUG_ON(vc == NULL);
acquire_console_sem();
vc->vc_tty = NULL;
vcs_remove_sysfs(tty);
release_console_sem();
tty_shutdown(tty);
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ extern void resume_console(void);
int mda_console_init(void);
void prom_con_init(void);

void vcs_make_sysfs(struct tty_struct *tty);
void vcs_remove_sysfs(struct tty_struct *tty);
void vcs_make_sysfs(int index);
void vcs_remove_sysfs(int index);

/* Some debug stub to catch some of the obvious races in the VT code */
#if 1
Expand Down

0 comments on commit 168c75c

Please sign in to comment.