Commit 9e040a3e authored by Jesper Nilsson's avatar Jesper Nilsson Committed by Linus Torvalds

CRISv10: fix serial driver proc-usage

drivers/serial/crisv10.c:4428: error: unknown field 'read_proc' specified in initializer

Commit 0f043a81 ("proc tty: remove struct
tty_operations::read_proc") removes the read_proc entry from struct
tty_operations.

Rework the proc handling in the CRISv10 serial driver to use proc_fops
instead.
Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mikael Starvik <starvik@axis.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cf94a4d1
...@@ -23,16 +23,18 @@ static char *serial_version = "$Revision: 1.25 $"; ...@@ -23,16 +23,18 @@ static char *serial_version = "$Revision: 1.25 $";
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/uaccess.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/seq_file.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/system.h> #include <asm/system.h>
#include <linux/delay.h>
#include <arch/svinto.h> #include <arch/svinto.h>
...@@ -456,7 +458,6 @@ static struct e100_serial rs_table[] = { ...@@ -456,7 +458,6 @@ static struct e100_serial rs_table[] = {
#define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial)) #define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial))
static struct ktermios *serial_termios[NR_PORTS];
#ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
static struct fast_timer fast_timers[NR_PORTS]; static struct fast_timer fast_timers[NR_PORTS];
#endif #endif
...@@ -4257,151 +4258,132 @@ rs_open(struct tty_struct *tty, struct file * filp) ...@@ -4257,151 +4258,132 @@ rs_open(struct tty_struct *tty, struct file * filp)
return 0; return 0;
} }
#ifdef CONFIG_PROC_FS
/* /*
* /proc fs routines.... * /proc fs routines....
*/ */
static int line_info(char *buf, struct e100_serial *info) static void seq_line_info(struct seq_file *m, struct e100_serial *info)
{ {
char stat_buf[30];
int ret;
unsigned long tmp; unsigned long tmp;
ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d", seq_printf(m, "%d: uart:E100 port:%lX irq:%d",
info->line, (unsigned long)info->ioport, info->irq); info->line, (unsigned long)info->ioport, info->irq);
if (!info->ioport || (info->type == PORT_UNKNOWN)) { if (!info->ioport || (info->type == PORT_UNKNOWN)) {
ret += sprintf(buf+ret, "\n"); seq_printf(m, "\n");
return ret; return;
} }
stat_buf[0] = 0; seq_printf(m, " baud:%d", info->baud);
stat_buf[1] = 0; seq_printf(m, " tx:%lu rx:%lu",
if (!E100_RTS_GET(info))
strcat(stat_buf, "|RTS");
if (!E100_CTS_GET(info))
strcat(stat_buf, "|CTS");
if (!E100_DTR_GET(info))
strcat(stat_buf, "|DTR");
if (!E100_DSR_GET(info))
strcat(stat_buf, "|DSR");
if (!E100_CD_GET(info))
strcat(stat_buf, "|CD");
if (!E100_RI_GET(info))
strcat(stat_buf, "|RI");
ret += sprintf(buf+ret, " baud:%d", info->baud);
ret += sprintf(buf+ret, " tx:%lu rx:%lu",
(unsigned long)info->icount.tx, (unsigned long)info->icount.tx,
(unsigned long)info->icount.rx); (unsigned long)info->icount.rx);
tmp = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); tmp = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
if (tmp) { if (tmp)
ret += sprintf(buf+ret, " tx_pend:%lu/%lu", seq_printf(m, " tx_pend:%lu/%lu",
(unsigned long)tmp, (unsigned long)tmp,
(unsigned long)SERIAL_XMIT_SIZE); (unsigned long)SERIAL_XMIT_SIZE);
}
ret += sprintf(buf+ret, " rx_pend:%lu/%lu", seq_printf(m, " rx_pend:%lu/%lu",
(unsigned long)info->recv_cnt, (unsigned long)info->recv_cnt,
(unsigned long)info->max_recv_cnt); (unsigned long)info->max_recv_cnt);
#if 1 #if 1
if (info->port.tty) { if (info->port.tty) {
if (info->port.tty->stopped) if (info->port.tty->stopped)
ret += sprintf(buf+ret, " stopped:%i", seq_printf(m, " stopped:%i",
(int)info->port.tty->stopped); (int)info->port.tty->stopped);
if (info->port.tty->hw_stopped) if (info->port.tty->hw_stopped)
ret += sprintf(buf+ret, " hw_stopped:%i", seq_printf(m, " hw_stopped:%i",
(int)info->port.tty->hw_stopped); (int)info->port.tty->hw_stopped);
} }
{ {
unsigned char rstat = info->ioport[REG_STATUS]; unsigned char rstat = info->ioport[REG_STATUS];
if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect))
ret += sprintf(buf+ret, " xoff_detect:1"); seq_printf(m, " xoff_detect:1");
} }
#endif #endif
if (info->icount.frame) if (info->icount.frame)
ret += sprintf(buf+ret, " fe:%lu", seq_printf(m, " fe:%lu", (unsigned long)info->icount.frame);
(unsigned long)info->icount.frame);
if (info->icount.parity) if (info->icount.parity)
ret += sprintf(buf+ret, " pe:%lu", seq_printf(m, " pe:%lu", (unsigned long)info->icount.parity);
(unsigned long)info->icount.parity);
if (info->icount.brk) if (info->icount.brk)
ret += sprintf(buf+ret, " brk:%lu", seq_printf(m, " brk:%lu", (unsigned long)info->icount.brk);
(unsigned long)info->icount.brk);
if (info->icount.overrun) if (info->icount.overrun)
ret += sprintf(buf+ret, " oe:%lu", seq_printf(m, " oe:%lu", (unsigned long)info->icount.overrun);
(unsigned long)info->icount.overrun);
/* /*
* Last thing is the RS-232 status lines * Last thing is the RS-232 status lines
*/ */
ret += sprintf(buf+ret, " %s\n", stat_buf+1); if (!E100_RTS_GET(info))
return ret; seq_puts(m, "|RTS");
if (!E100_CTS_GET(info))
seq_puts(m, "|CTS");
if (!E100_DTR_GET(info))
seq_puts(m, "|DTR");
if (!E100_DSR_GET(info))
seq_puts(m, "|DSR");
if (!E100_CD_GET(info))
seq_puts(m, "|CD");
if (!E100_RI_GET(info))
seq_puts(m, "|RI");
seq_puts(m, "\n");
} }
int rs_read_proc(char *page, char **start, off_t off, int count,
int *eof, void *data) static int crisv10_proc_show(struct seq_file *m, void *v)
{ {
int i, len = 0, l; int i;
off_t begin = 0;
len += sprintf(page, "serinfo:1.0 driver:%s\n", seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version);
serial_version);
for (i = 0; i < NR_PORTS && len < 4000; i++) { for (i = 0; i < NR_PORTS; i++) {
if (!rs_table[i].enabled) if (!rs_table[i].enabled)
continue; continue;
l = line_info(page + len, &rs_table[i]); seq_line_info(m, &rs_table[i]);
len += l;
if (len+begin > off+count)
goto done;
if (len+begin < off) {
begin += len;
len = 0;
}
} }
#ifdef DEBUG_LOG_INCLUDED #ifdef DEBUG_LOG_INCLUDED
for (i = 0; i < debug_log_pos; i++) { for (i = 0; i < debug_log_pos; i++) {
len += sprintf(page + len, "%-4i %lu.%lu ", i, debug_log[i].time, timer_data_to_ns(debug_log[i].timer_data)); seq_printf(m, "%-4i %lu.%lu ",
len += sprintf(page + len, debug_log[i].string, debug_log[i].value); i, debug_log[i].time,
if (len+begin > off+count) timer_data_to_ns(debug_log[i].timer_data));
goto done; seq_printf(m, debug_log[i].string, debug_log[i].value);
if (len+begin < off) {
begin += len;
len = 0;
}
} }
len += sprintf(page + len, "debug_log %i/%i %li bytes\n", seq_printf(m, "debug_log %i/%i\n", i, DEBUG_LOG_SIZE);
i, DEBUG_LOG_SIZE, begin+len);
debug_log_pos = 0; debug_log_pos = 0;
#endif #endif
return 0;
}
*eof = 1; static int crisv10_proc_open(struct inode *inode, struct file *file)
done: {
if (off >= len+begin) return single_open(file, crisv10_proc_show, NULL);
return 0;
*start = page + (off-begin);
return ((count < begin+len-off) ? count : begin+len-off);
} }
static const struct file_operations crisv10_proc_fops = {
.owner = THIS_MODULE,
.open = crisv10_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif
/* Finally, routines used to initialize the serial driver. */ /* Finally, routines used to initialize the serial driver. */
static void static void show_serial_version(void)
show_serial_version(void)
{ {
printk(KERN_INFO printk(KERN_INFO
"ETRAX 100LX serial-driver %s, (c) 2000-2004 Axis Communications AB\r\n", "ETRAX 100LX serial-driver %s, "
"(c) 2000-2004 Axis Communications AB\r\n",
&serial_version[11]); /* "$Revision: x.yy" */ &serial_version[11]); /* "$Revision: x.yy" */
} }
...@@ -4425,13 +4407,14 @@ static const struct tty_operations rs_ops = { ...@@ -4425,13 +4407,14 @@ static const struct tty_operations rs_ops = {
.break_ctl = rs_break, .break_ctl = rs_break,
.send_xchar = rs_send_xchar, .send_xchar = rs_send_xchar,
.wait_until_sent = rs_wait_until_sent, .wait_until_sent = rs_wait_until_sent,
.read_proc = rs_read_proc,
.tiocmget = rs_tiocmget, .tiocmget = rs_tiocmget,
.tiocmset = rs_tiocmset .tiocmset = rs_tiocmset,
#ifdef CONFIG_PROC_FS
.proc_fops = &crisv10_proc_fops,
#endif
}; };
static int __init static int __init rs_init(void)
rs_init(void)
{ {
int i; int i;
struct e100_serial *info; struct e100_serial *info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment