diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-03-18 17:17:51 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-03-18 17:17:51 +0000 |
commit | f1382dc4850bb459d24a81c6cb0ef93ea7bd4a79 (patch) | |
tree | 225271a3d5dcd4e9dea5ee393556abd754c964b1 /drivers/char | |
parent | 135b00fc2e90e605ac2a96b20b0ebd93851a3f89 (diff) |
o Merge with Linux 2.1.90.
o Divide L1 cache sizes by 1024 before printing, makes the numbers a
bit more credible ...
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ChangeLog | 8 | ||||
-rw-r--r-- | drivers/char/Config.in | 5 | ||||
-rw-r--r-- | drivers/char/apm_bios.c | 8 | ||||
-rw-r--r-- | drivers/char/esp.c | 4 | ||||
-rw-r--r-- | drivers/char/ftape/zftape/zftape-ctl.c | 3 | ||||
-rw-r--r-- | drivers/char/ftape/zftape/zftape-init.c | 6 | ||||
-rw-r--r-- | drivers/char/ftape/zftape/zftape-read.c | 4 | ||||
-rw-r--r-- | drivers/char/ftape/zftape/zftape-write.c | 4 | ||||
-rw-r--r-- | drivers/char/lp_m68k.c | 6 | ||||
-rw-r--r-- | drivers/char/misc.c | 9 | ||||
-rw-r--r-- | drivers/char/n_tty.c | 7 | ||||
-rw-r--r-- | drivers/char/rtc.c | 57 | ||||
-rw-r--r-- | drivers/char/serial.c | 4 | ||||
-rw-r--r-- | drivers/char/tty_io.c | 51 | ||||
-rw-r--r-- | drivers/char/tty_ioctl.c | 7 |
15 files changed, 73 insertions, 110 deletions
diff --git a/drivers/char/ChangeLog b/drivers/char/ChangeLog index 56e762e71..95d6741c5 100644 --- a/drivers/char/ChangeLog +++ b/drivers/char/ChangeLog @@ -1,3 +1,11 @@ +Thu Feb 19 14:24:08 1998 Theodore Ts'o <tytso@rsts-11.mit.edu> + + * tty_io.c (tty_name): Remove the non-reentrant (and non-SMP safe) + version of tty_name, and rename the reentrant _tty_name + function to be tty_name. + (tty_open): Add a warning message stating callout devices + are deprecated. + Mon Dec 1 08:24:15 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (tty_get_baud_rate): Print a warning syslog if the diff --git a/drivers/char/Config.in b/drivers/char/Config.in index ffb6287a7..e17a220e6 100644 --- a/drivers/char/Config.in +++ b/drivers/char/Config.in @@ -110,11 +110,6 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT fi bool 'Enhanced Real Time Clock Support' CONFIG_RTC -if [ "$CONFIG_RTC" = "y" ]; then - if [ "$ARCH" = "alpha" ]; then - bool ' ARC console time' CONFIG_RTC_ARC y - fi -fi if [ "$CONFIG_ALPHA_BOOK1" = "y" ]; then bool 'Tadpole ANA H8 Support' CONFIG_H8 fi diff --git a/drivers/char/apm_bios.c b/drivers/char/apm_bios.c index b425ab694..94f13f8fd 100644 --- a/drivers/char/apm_bios.c +++ b/drivers/char/apm_bios.c @@ -1203,17 +1203,17 @@ __initfunc(void apm_bios_init(void)) * even though they are called in protected mode. */ set_base(gdt[APM_40 >> 3], - 0xc0000000 + ((unsigned long)0x40 << 4)); + __va((unsigned long)0x40 << 4)); set_limit(gdt[APM_40 >> 3], 4096 - (0x40 << 4)); apm_bios_entry.offset = apm_bios_info.offset; apm_bios_entry.segment = APM_CS; set_base(gdt[APM_CS >> 3], - 0xc0000000 + ((unsigned long)apm_bios_info.cseg << 4)); + __va((unsigned long)apm_bios_info.cseg << 4)); set_base(gdt[APM_CS_16 >> 3], - 0xc0000000 + ((unsigned long)apm_bios_info.cseg_16 << 4)); + __va((unsigned long)apm_bios_info.cseg_16 << 4)); set_base(gdt[APM_DS >> 3], - 0xc0000000 + ((unsigned long)apm_bios_info.dseg << 4)); + __va((unsigned long)apm_bios_info.dseg << 4)); if (apm_bios_info.version == 0x100) { set_limit(gdt[APM_CS >> 3], 64 * 1024); set_limit(gdt[APM_CS_16 >> 3], 64 * 1024); diff --git a/drivers/char/esp.c b/drivers/char/esp.c index 089ce7b2d..2ea9cb86f 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c @@ -1384,7 +1384,7 @@ static void rs_throttle(struct tty_struct * tty) #ifdef SERIAL_DEBUG_THROTTLE char buf[64]; - printk("throttle %s: %d....\n", _tty_name(tty, buf), + printk("throttle %s: %d....\n", tty_name(tty, buf), tty->ldisc.chars_in_buffer(tty)); #endif @@ -1406,7 +1406,7 @@ static void rs_unthrottle(struct tty_struct * tty) #ifdef SERIAL_DEBUG_THROTTLE char buf[64]; - printk("unthrottle %s: %d....\n", _tty_name(tty, buf), + printk("unthrottle %s: %d....\n", tty_name(tty, buf), tty->ldisc.chars_in_buffer(tty)); #endif diff --git a/drivers/char/ftape/zftape/zftape-ctl.c b/drivers/char/ftape/zftape/zftape-ctl.c index 19d10c95b..3b80c207f 100644 --- a/drivers/char/ftape/zftape/zftape-ctl.c +++ b/drivers/char/ftape/zftape/zftape-ctl.c @@ -29,9 +29,6 @@ #include <linux/mm.h> #define __NO_VERSION__ #include <linux/module.h> -#ifdef CONFIG_KERNELD -#include <linux/kerneld.h> -#endif #include <linux/fcntl.h> #include <linux/zftape.h> diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c index 0c8a6f9eb..78a857ace 100644 --- a/drivers/char/ftape/zftape/zftape-init.c +++ b/drivers/char/ftape/zftape/zftape-init.c @@ -30,8 +30,8 @@ #include <linux/signal.h> #include <linux/major.h> #include <linux/malloc.h> -#ifdef CONFIG_KERNELD -#include <linux/kerneld.h> +#ifdef CONFIG_KMOD +#include <linux/kmod.h> #endif #include <linux/fcntl.h> #include <linux/wrapper.h> @@ -391,7 +391,7 @@ struct zft_cmpr_ops *zft_cmpr_unregister(void) int zft_cmpr_lock(int try_to_load) { if (zft_cmpr_ops == NULL) { -#ifdef CONFIG_KERNELD +#ifdef CONFIG_KMOD if (try_to_load) { request_module("zft-compressor"); if (zft_cmpr_ops == NULL) { diff --git a/drivers/char/ftape/zftape/zftape-read.c b/drivers/char/ftape/zftape/zftape-read.c index c7d319fac..91ed51423 100644 --- a/drivers/char/ftape/zftape/zftape-read.c +++ b/drivers/char/ftape/zftape/zftape-read.c @@ -24,12 +24,8 @@ * for the QIC-117 floppy-tape driver for Linux. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/mm.h> -#ifdef CONFIG_KERNELD -#include <linux/kerneld.h> -#endif #include <linux/zftape.h> diff --git a/drivers/char/ftape/zftape/zftape-write.c b/drivers/char/ftape/zftape/zftape-write.c index 46f1ecc09..03b126f49 100644 --- a/drivers/char/ftape/zftape/zftape-write.c +++ b/drivers/char/ftape/zftape/zftape-write.c @@ -24,12 +24,8 @@ * for the QIC-117 floppy-tape driver for Linux. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/mm.h> -#ifdef CONFIG_KERNELD -#include <linux/kerneld.h> -#endif #include <linux/zftape.h> diff --git a/drivers/char/lp_m68k.c b/drivers/char/lp_m68k.c index a36903c7a..4a000e9aa 100644 --- a/drivers/char/lp_m68k.c +++ b/drivers/char/lp_m68k.c @@ -43,8 +43,8 @@ #include <linux/string.h> #include <linux/init.h> #include <asm/irq.h> -#ifdef CONFIG_KERNELD -#include <linux/kerneld.h> +#ifdef CONFIG_KMOD +#include <linux/kmod.h> #endif #ifdef CONFIG_AMIGA @@ -365,7 +365,7 @@ static int lp_open(struct inode *inode, struct file *file) if (dev >= MAX_LP) return -ENODEV; -#ifdef CONFIG_KERNELD +#ifdef CONFIG_KMOD if (!lp_table[dev]) { char modname[30]; diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 665b9ec9d..b3b283015 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -26,6 +26,9 @@ * Idea by Jacques Gelinas <jack@solucorp.qc.ca>, * adapted by Bjorn Ekwall <bj0rn@blox.se> * corrected by Alan Cox <alan@lxorguk.ukuu.org.uk> + * + * Changes for kmod (from kerneld): + Cyrus Durgin <cider@speakeasy.org> */ #include <linux/config.h> @@ -46,8 +49,8 @@ #include <linux/tty.h> #include <linux/selection.h> -#ifdef CONFIG_KERNELD -#include <linux/kerneld.h> +#ifdef CONFIG_KMOD +#include <linux/kmod.h> #endif /* @@ -109,7 +112,7 @@ static int misc_open(struct inode * inode, struct file * file) while ((c != &misc_list) && (c->minor != minor)) c = c->next; if (c == &misc_list) { -#ifdef CONFIG_KERNELD +#ifdef CONFIG_KMOD char modname[20]; sprintf(modname, "char-major-%d-%d", MISC_MAJOR, minor); request_module(modname); diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 3d2f2b18c..a434cf405 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -420,7 +420,7 @@ static inline void n_tty_receive_overrun(struct tty_struct *tty) tty->num_overrun++; if (tty->overrun_time < (jiffies - HZ)) { - printk("%s: %d input overrun(s)\n", _tty_name(tty, buf), + printk("%s: %d input overrun(s)\n", tty_name(tty, buf), tty->num_overrun); tty->overrun_time = jiffies; tty->num_overrun = 0; @@ -656,6 +656,7 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, const unsigned char *p; char *f, flags = TTY_NORMAL; int i; + char buf[64]; if (!tty->read_buf) return; @@ -693,8 +694,8 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, n_tty_receive_overrun(tty); break; default: - printk("%s: unknown flag %d\n", tty_name(tty), - flags); + printk("%s: unknown flag %d\n", + tty_name(tty, buf), flags); break; } } diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 26d15d182..9edca1683 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -48,7 +48,6 @@ * this driver.) */ -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/miscdevice.h> @@ -63,13 +62,6 @@ #include <asm/uaccess.h> #include <asm/system.h> -/* Adjust starting epoch if ARC console time is being used */ -#ifdef CONFIG_RTC_ARC -#define ARCFUDGE 20 -#else -#define ARCFUDGE 0 -#endif - /* * We sponge a minor off of the misc major. No need slurping * up another valuable major dev number for this. If you add @@ -126,12 +118,8 @@ unsigned char days_in_mo[] = * so that there is no possibility of conflicting with the * set_rtc_mmss() call that happens during some timer interrupts. * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) - * - * On Alpha we won't get any interrupts anyway, as they all end up - * in the system timer code. */ -#ifndef __alpha__ static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* @@ -152,11 +140,9 @@ static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) add_timer(&rtc_irq_timer); } } -#endif /* * Now all the various file operations that we export. - * They are all useless on Alpha... *sigh*. */ static long long rtc_llseek(struct file *file, loff_t offset, int origin) @@ -167,9 +153,6 @@ static long long rtc_llseek(struct file *file, loff_t offset, int origin) static ssize_t rtc_read(struct file *file, char *buf, size_t count, loff_t *ppos) { -#ifdef __alpha__ - return -EIO; -#else struct wait_queue wait = { current, NULL }; unsigned long data; ssize_t retval; @@ -201,7 +184,6 @@ static ssize_t rtc_read(struct file *file, char *buf, remove_wait_queue(&rtc_wait, &wait); return retval; -#endif } static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, @@ -212,7 +194,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, struct rtc_time wtime; switch (cmd) { -#ifndef __alpha__ case RTC_AIE_OFF: /* Mask alarm int. enab. bit */ { mask_rtc_irq_bit(RTC_AIE); @@ -260,7 +241,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, set_rtc_irq_bit(RTC_UIE); return 0; } -#endif case RTC_ALM_READ: /* Read the present alarm time */ { /* @@ -335,7 +315,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, sizeof(struct rtc_time))) return -EFAULT; - yrs = rtc_tm.tm_year + 1900 + ARCFUDGE; + yrs = rtc_tm.tm_year + 1900; mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ day = rtc_tm.tm_mday; hrs = rtc_tm.tm_hour; @@ -400,7 +380,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, { return put_user(rtc_freq, (unsigned long *)arg); } -#ifndef __alpha__ case RTC_IRQP_SET: /* Set periodic IRQ rate. */ { int tmp = 0; @@ -437,7 +416,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, restore_flags(flags); return 0; } -#else /* __alpha__ */ +#ifdef __alpha__ case RTC_EPOCH_READ: /* Read the epoch. */ { return put_user (epoch, (unsigned long *)arg); @@ -467,18 +446,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, * We enforce only one user at a time here with the open/close. * Also clear the previous interrupt data on an open, and clean * up things on a close. - * On Alpha we just open, for we don't mess with interrups anyway. */ static int rtc_open(struct inode *inode, struct file *file) { -#ifndef __alpha__ if(rtc_status & RTC_IS_OPEN) return -EBUSY; rtc_status |= RTC_IS_OPEN; rtc_irq_data = 0; -#endif return 0; } @@ -489,7 +465,6 @@ static int rtc_release(struct inode *inode, struct file *file) * in use, and clear the data. */ -#ifndef __alpha__ unsigned char tmp; unsigned long flags; @@ -510,11 +485,9 @@ static int rtc_release(struct inode *inode, struct file *file) rtc_irq_data = 0; rtc_status &= ~RTC_IS_OPEN; -#endif return 0; } -#ifndef __alpha__ static unsigned int rtc_poll(struct file *file, poll_table *wait) { poll_wait(file, &rtc_wait, wait); @@ -522,7 +495,6 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait) return POLLIN | POLLRDNORM; return 0; } -#endif /* * The various file operations we support. @@ -533,11 +505,7 @@ static struct file_operations rtc_fops = { rtc_read, NULL, /* No write */ NULL, /* No readdir */ -#ifdef __alpha__ - NULL, /* No select on Alpha */ -#else rtc_poll, -#endif rtc_ioctl, NULL, /* No mmap */ rtc_open, @@ -560,14 +528,12 @@ __initfunc(int rtc_init(void)) char *guess = NULL; #endif printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION); -#ifndef __alpha__ if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) { /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); return -EIO; } -#endif misc_register(&rtc_dev); /* Check region? Naaah! Just snarf it up. */ request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); @@ -599,8 +565,8 @@ __initfunc(int rtc_init(void)) guess = "Digital UNIX"; } if (guess) - printk("rtc: %s epoch (%ld) detected\n", guess, epoch); -#else + printk("rtc: %s epoch (%lu) detected\n", guess, epoch); +#endif init_timer(&rtc_irq_timer); rtc_irq_timer.function = rtc_dropped_irq; rtc_wait = NULL; @@ -610,7 +576,6 @@ __initfunc(int rtc_init(void)) CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT); restore_flags(flags); rtc_freq = 1024; -#endif return 0; } @@ -626,7 +591,6 @@ __initfunc(int rtc_init(void)) * for something that requires a steady > 1KHz signal anyways.) */ -#ifndef __alpha__ void rtc_dropped_irq(unsigned long data) { unsigned long flags; @@ -643,7 +607,6 @@ void rtc_dropped_irq(unsigned long data) rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */ restore_flags(flags); } -#endif /* * Info exported via "/proc/rtc". @@ -672,9 +635,10 @@ int get_rtc_status(char *buf) */ p += sprintf(p, "rtc_time\t: %02d:%02d:%02d\n" - "rtc_date\t: %04d-%02d-%02d\n", + "rtc_date\t: %04d-%02d-%02d\n" + "rtc_epoch\t: %04lu\n", tm.tm_hour, tm.tm_min, tm.tm_sec, - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch); get_rtc_alm_time(&tm); @@ -788,12 +752,9 @@ void get_rtc_time(struct rtc_time *rtc_tm) * Account for differences between how the RTC uses the values * and how they are defined in a struct rtc_time; */ - if ((rtc_tm->tm_year += epoch - 1900) <= 69) + if ((rtc_tm->tm_year += (epoch - 1900)) <= 69) rtc_tm->tm_year += 100; - /* if ARCFUDGE == 0, the optimizer should do away with this */ - rtc_tm->tm_year -= ARCFUDGE; - rtc_tm->tm_mon--; } @@ -832,7 +793,6 @@ void get_rtc_alm_time(struct rtc_time *alm_tm) * meddles with the interrupt enable/disable bits. */ -#ifndef __alpha__ void mask_rtc_irq_bit(unsigned char bit) { unsigned char val; @@ -862,4 +822,3 @@ void set_rtc_irq_bit(unsigned char bit) rtc_irq_data = 0; restore_flags(flags); } -#endif diff --git a/drivers/char/serial.c b/drivers/char/serial.c index 7af575780..b81a8eb8f 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -1745,7 +1745,7 @@ static void rs_throttle(struct tty_struct * tty) #ifdef SERIAL_DEBUG_THROTTLE char buf[64]; - printk("throttle %s: %d....\n", _tty_name(tty, buf), + printk("throttle %s: %d....\n", tty_name(tty, buf), tty->ldisc.chars_in_buffer(tty)); #endif @@ -1769,7 +1769,7 @@ static void rs_unthrottle(struct tty_struct * tty) #ifdef SERIAL_DEBUG_THROTTLE char buf[64]; - printk("unthrottle %s: %d....\n", _tty_name(tty, buf), + printk("unthrottle %s: %d....\n", tty_name(tty, buf), tty->ldisc.chars_in_buffer(tty)); #endif diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index dcc38830f..5d100bba4 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -87,8 +87,8 @@ #include <linux/vt_kern.h> #include <linux/selection.h> -#ifdef CONFIG_KERNELD -#include <linux/kerneld.h> +#ifdef CONFIG_KMOD +#include <linux/kmod.h> #endif #define CONSOLE_DEV MKDEV(TTY_MAJOR,0) @@ -127,11 +127,9 @@ static int tty_fasync(struct file * filp, int on); #endif /* - * These two routines return the name of tty. tty_name() should NOT - * be used in interrupt drivers, since it's not re-entrant. Use - * _tty_name() instead. + * This routine returns the name of tty. */ -char *_tty_name(struct tty_struct *tty, char *buf) +char *tty_name(struct tty_struct *tty, char *buf) { if (tty) sprintf(buf, "%s%d", tty->driver.name, @@ -142,13 +140,6 @@ char *_tty_name(struct tty_struct *tty, char *buf) return buf; } -char *tty_name(struct tty_struct *tty) -{ - static char buf[64]; - - return(_tty_name(tty, buf)); -} - inline int tty_paranoia_check(struct tty_struct *tty, kdev_t device, const char *routine) { @@ -213,11 +204,13 @@ static int tty_set_ldisc(struct tty_struct *tty, int ldisc) { int retval = 0; struct tty_ldisc o_ldisc; + char buf[64]; if ((ldisc < N_TTY) || (ldisc >= NR_LDISCS)) return -EINVAL; -#ifdef CONFIG_KERNELD +#ifdef CONFIG_KMOD /* Eduardo Blanco <ejbs@cs.cs.com.uy> */ + /* Cyrus Durgin <cider@speakeasy.org> */ if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED)) { char modname [20]; sprintf(modname, "tty-ldisc-%d", ldisc); @@ -254,7 +247,7 @@ static int tty_set_ldisc(struct tty_struct *tty, int ldisc) if (r < 0) panic("Couldn't open N_TTY ldisc for " "%s --- error %d.", - tty_name(tty), r); + tty_name(tty, buf), r); } } } @@ -455,7 +448,9 @@ void do_tty_hangup(void *data) void tty_hangup(struct tty_struct * tty) { #ifdef TTY_DEBUG_HANGUP - printk("%s hangup...\n", tty_name(tty)); + char buf[64]; + + printk("%s hangup...\n", tty_name(tty, buf)); #endif queue_task(&tty->tq_hangup, &tq_timer); } @@ -463,7 +458,9 @@ void tty_hangup(struct tty_struct * tty) void tty_vhangup(struct tty_struct * tty) { #ifdef TTY_DEBUG_HANGUP - printk("%s vhangup...\n", tty_name(tty)); + char buf[64]; + + printk("%s vhangup...\n", tty_name(tty, buf)); #endif do_tty_hangup((void *) tty); } @@ -950,6 +947,7 @@ static void release_dev(struct file * filp) struct tty_struct *tty, *o_tty; int pty_master, tty_closing, o_tty_closing, do_sleep; int idx; + char buf[64]; tty = (struct tty_struct *)filp->private_data; if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "release_dev")) @@ -990,7 +988,7 @@ static void release_dev(struct file * filp) #endif #ifdef TTY_DEBUG_HANGUP - printk("release_dev of %s (tty count=%d)...", tty_name(tty), + printk("release_dev of %s (tty count=%d)...", tty_name(tty, buf), tty->count); #endif @@ -1068,7 +1066,7 @@ static void release_dev(struct file * filp) break; printk("release_dev: %s: read/write wait queue active!\n", - tty_name(tty)); + tty_name(tty, buf)); schedule(); } @@ -1084,13 +1082,13 @@ static void release_dev(struct file * filp) if (pty_master) { if (--o_tty->count < 0) { printk("release_dev: bad pty slave count (%d) for %s\n", - o_tty->count, tty_name(o_tty)); + o_tty->count, tty_name(o_tty, buf)); o_tty->count = 0; } } if (--tty->count < 0) { printk("release_dev: bad tty->count (%d) for %s\n", - tty->count, tty_name(tty)); + tty->count, tty_name(tty, buf)); tty->count = 0; } @@ -1178,6 +1176,7 @@ static int tty_open(struct inode * inode, struct file * filp) int noctty, retval; kdev_t device; unsigned short saved_flags; + char buf[64]; saved_flags = filp->f_flags; retry_open: @@ -1245,7 +1244,7 @@ init_dev_done: tty->driver.subtype == PTY_TYPE_MASTER) noctty = 1; #ifdef TTY_DEBUG_HANGUP - printk("opening %s...", tty_name(tty)); + printk("opening %s...", tty_name(tty, buf)); #endif if (tty->driver.open) retval = tty->driver.open(tty, filp); @@ -1258,7 +1257,8 @@ init_dev_done: if (retval) { #ifdef TTY_DEBUG_HANGUP - printk("error %d in opening %s...", retval, tty_name(tty)); + printk("error %d in opening %s...", retval, + tty_name(tty, buf)); #endif release_dev(filp); @@ -1282,6 +1282,11 @@ init_dev_done: tty->session = current->session; tty->pgrp = current->pgrp; } + if ((tty->driver.type == TTY_DRIVER_TYPE_SERIAL) && + (tty->driver.subtype == SERIAL_TYPE_CALLOUT)) { + printk("Warning, %s opened, is a deprecated tty " + "callout device\n", tty_name(tty, buf)); + } return 0; } diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 21c09384e..735a955fc 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -45,7 +45,9 @@ void tty_wait_until_sent(struct tty_struct * tty, int timeout) struct wait_queue wait = { current, NULL }; #ifdef TTY_DEBUG_WAIT_UNTIL_SENT - printk("%s wait until sent...\n", tty_name(tty)); + char buf[64]; + + printk("%s wait until sent...\n", tty_name(tty, buf)); #endif if (!tty->driver.chars_in_buffer) return; @@ -57,7 +59,8 @@ void tty_wait_until_sent(struct tty_struct * tty, int timeout) current->timeout = (unsigned) -1; do { #ifdef TTY_DEBUG_WAIT_UNTIL_SENT - printk("waiting %s...(%d)\n", tty_name(tty), tty->driver.chars_in_buffer(tty)); + printk("waiting %s...(%d)\n", tty_name(tty, buf), + tty->driver.chars_in_buffer(tty)); #endif current->state = TASK_INTERRUPTIBLE; if (signal_pending(current)) |