real_tty = (struct tty_struct *)file->private_data;
if (!real_tty)
return -EINVAL;
- return put_user(kdev_t_to_nr(real_tty->device), ptr);
+ return put_user(real_tty->device, ptr);
}
set_bit(TTY_OTHER_CLOSED, &tty->flags);
#ifdef CONFIG_UNIX98_PTYS
{
- unsigned int major = major(tty->device) - UNIX98_PTY_MASTER_MAJOR;
+ unsigned int major = MAJOR(tty->device) - UNIX98_PTY_MASTER_MAJOR;
if ( major < UNIX98_NR_MAJORS ) {
devpts_pty_kill( tty->index + tty->driver->name_base );
}
if(!tty)
goto fail_no_mem;
initialize_tty_struct(tty);
- tty->device = mk_kdev(driver->major, driver->minor_start + idx);
+ tty->device = MKDEV(driver->major, driver->minor_start) + idx;
tty->driver = driver;
tty->index = idx;
tty_line_name(driver, idx, tty->name);
if (!o_tty)
goto free_mem_out;
initialize_tty_struct(o_tty);
- o_tty->device = mk_kdev(driver->other->major,
- driver->other->minor_start + idx);
+ o_tty->device = MKDEV(driver->other->major,
+ driver->other->minor_start) + idx;
o_tty->driver = driver->other;
o_tty->index = idx;
tty_line_name(driver->other, idx, o_tty->name);
if (IS_TTY_DEV(device)) {
if (!current->tty)
return -ENXIO;
- device = current->tty->device;
+ device = to_kdev_t(current->tty->device);
filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */
/* noctty = 1; */
}
/* Find a free SLIP channel, and link in this `tty' line. */
static struct slip *
-sl_alloc(kdev_t line)
+sl_alloc(dev_t line)
{
struct slip *sl;
slip_ctrl_t *slp = NULL;
break;
if (slp->ctrl.leased) {
- if (!kdev_same(slp->ctrl.line, line))
+ if (slp->ctrl.line != line)
continue;
if (slp->ctrl.tty)
return NULL;
continue;
if (current->pid == slp->ctrl.pid) {
- if (kdev_same(slp->ctrl.line, line) && score < 3) {
+ if (slp->ctrl.line == line && score < 3) {
sel = i;
score = 3;
continue;
}
continue;
}
- if (kdev_same(slp->ctrl.line, line) && score < 1) {
+ if (slp->ctrl.line == line && score < 1) {
sel = i;
score = 1;
continue;
tty->disc_data = 0;
sl->tty = NULL;
if (!sl->leased)
- sl->line = NODEV;
+ sl->line = 0;
/* VSV = very important to remove timers */
#ifdef CONFIG_SLIP_SMART
unsigned char mode; /* SLIP mode */
unsigned char leased;
- kdev_t line;
+ dev_t line;
pid_t pid;
#define SL_MODE_SLIP 0
#define SL_MODE_CSLIP 1
atomic_inc(&mm->mm_users);
if (task->tty) {
tty_pgrp = task->tty->pgrp;
- tty_nr = kdev_t_to_nr(task->tty->device);
+ tty_nr = task->tty->device;
}
task_unlock(task);
if (mm) {
char name[64];
int pgrp;
int session;
- kdev_t device;
+ dev_t device;
unsigned long flags;
int count;
struct winsize winsize;
ac.ac_stime = encode_comp_t(current->stime);
ac.ac_uid = current->uid;
ac.ac_gid = current->gid;
- ac.ac_tty = (current->tty) ? kdev_t_to_nr(current->tty->device) : 0;
+ ac.ac_tty = current->tty ? current->tty->device : 0;
ac.ac_flag = 0;
if (current->flags & PF_FORKNOEXEC)