From: Jesper Nilsson <Jesper.Nilsson@axis.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: origin tree build failure
Date: Tue, 14 Apr 2009 09:58:53 +0200 [thread overview]
Message-ID: <20090414075853.GA21811@axis.com> (raw)
In-Reply-To: <20090414173423.2b9ab235.sfr@canb.auug.org.au>
On Tue, Apr 14, 2009 at 09:34:23AM +0200, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next build (cris etrax-100lx_defconfig) failed like this:
>
> drivers/serial/crisv10.c:4428: error: unknown field 'read_proc' specified in initializer
>
> Caused by commit 0f043a81ebe84be3576667f04fdda481609e3816 ("proc tty:
> remove struct tty_operations::read_proc").
Hi,
I have the following patch (sent Wed 8 Apr) for this failure:
CRISv10: Change serial driver proc-usage.
Commit 0f043a81ebe84be3576667f04fdda481609e3816 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: Jesper Nilsson <jesper.nilsson@axis.com>
--
crisv10.c | 173 +++++++++++++++++++++++++++-----------------------------------
1 file changed, 78 insertions(+), 95 deletions(-)
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index e642c22..4719935 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -23,16 +23,18 @@ static char *serial_version = "$Revision: 1.25 $";
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/init.h>
-#include <asm/uaccess.h>
#include <linux/kernel.h>
#include <linux/mutex.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/dma.h>
#include <asm/system.h>
-#include <linux/delay.h>
#include <arch/svinto.h>
@@ -456,7 +458,6 @@ static struct e100_serial rs_table[] = {
#define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial))
-static struct ktermios *serial_termios[NR_PORTS];
#ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
static struct fast_timer fast_timers[NR_PORTS];
#endif
@@ -4220,151 +4221,132 @@ rs_open(struct tty_struct *tty, struct file * filp)
return 0;
}
+#ifdef CONFIG_PROC_FS
/*
* /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;
- ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d",
- info->line, (unsigned long)info->ioport, info->irq);
+ seq_printf(m, "%d: uart:E100 port:%lX irq:%d",
+ info->line, (unsigned long)info->ioport, info->irq);
if (!info->ioport || (info->type == PORT_UNKNOWN)) {
- ret += sprintf(buf+ret, "\n");
- return ret;
+ seq_printf(m, "\n");
+ return;
}
- stat_buf[0] = 0;
- stat_buf[1] = 0;
- 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",
+ seq_printf(m, " baud:%d", info->baud);
+ seq_printf(m, " tx:%lu rx:%lu",
(unsigned long)info->icount.tx,
(unsigned long)info->icount.rx);
tmp = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
- if (tmp) {
- ret += sprintf(buf+ret, " tx_pend:%lu/%lu",
- (unsigned long)tmp,
- (unsigned long)SERIAL_XMIT_SIZE);
- }
+ if (tmp)
+ seq_printf(m, " tx_pend:%lu/%lu",
+ (unsigned long)tmp,
+ (unsigned long)SERIAL_XMIT_SIZE);
- ret += sprintf(buf+ret, " rx_pend:%lu/%lu",
- (unsigned long)info->recv_cnt,
- (unsigned long)info->max_recv_cnt);
+ seq_printf(m, " rx_pend:%lu/%lu",
+ (unsigned long)info->recv_cnt,
+ (unsigned long)info->max_recv_cnt);
#if 1
if (info->port.tty) {
-
if (info->port.tty->stopped)
- ret += sprintf(buf+ret, " stopped:%i",
- (int)info->port.tty->stopped);
+ seq_printf(m, " stopped:%i",
+ (int)info->port.tty->stopped);
if (info->port.tty->hw_stopped)
- ret += sprintf(buf+ret, " hw_stopped:%i",
- (int)info->port.tty->hw_stopped);
+ seq_printf(m, " hw_stopped:%i",
+ (int)info->port.tty->hw_stopped);
}
{
unsigned char rstat = info->ioport[REG_STATUS];
- if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) )
- ret += sprintf(buf+ret, " xoff_detect:1");
+ if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect))
+ seq_printf(m, " xoff_detect:1");
}
#endif
-
-
-
if (info->icount.frame)
- ret += sprintf(buf+ret, " fe:%lu",
- (unsigned long)info->icount.frame);
+ seq_printf(m, " fe:%lu", (unsigned long)info->icount.frame);
if (info->icount.parity)
- ret += sprintf(buf+ret, " pe:%lu",
- (unsigned long)info->icount.parity);
+ seq_printf(m, " pe:%lu", (unsigned long)info->icount.parity);
if (info->icount.brk)
- ret += sprintf(buf+ret, " brk:%lu",
- (unsigned long)info->icount.brk);
+ seq_printf(m, " brk:%lu", (unsigned long)info->icount.brk);
if (info->icount.overrun)
- ret += sprintf(buf+ret, " oe:%lu",
- (unsigned long)info->icount.overrun);
+ seq_printf(m, " oe:%lu", (unsigned long)info->icount.overrun);
/*
* Last thing is the RS-232 status lines
*/
- ret += sprintf(buf+ret, " %s\n", stat_buf+1);
- return ret;
+ if (!E100_RTS_GET(info))
+ 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;
- off_t begin = 0;
+ int i;
- len += sprintf(page, "serinfo:1.0 driver:%s\n",
- serial_version);
- for (i = 0; i < NR_PORTS && len < 4000; i++) {
+ seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version);
+
+ for (i = 0; i < NR_PORTS; i++) {
if (!rs_table[i].enabled)
continue;
- l = line_info(page + len, &rs_table[i]);
- len += l;
- if (len+begin > off+count)
- goto done;
- if (len+begin < off) {
- begin += len;
- len = 0;
- }
+ seq_line_info(m, &rs_table[i]);
}
#ifdef DEBUG_LOG_INCLUDED
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));
- len += sprintf(page + len, debug_log[i].string, debug_log[i].value);
- if (len+begin > off+count)
- goto done;
- if (len+begin < off) {
- begin += len;
- len = 0;
- }
+ seq_printf(m, "%-4i %lu.%lu ",
+ i, debug_log[i].time,
+ timer_data_to_ns(debug_log[i].timer_data));
+ seq_printf(m, debug_log[i].string, debug_log[i].value);
}
- len += sprintf(page + len, "debug_log %i/%i %li bytes\n",
- i, DEBUG_LOG_SIZE, begin+len);
+ seq_printf(m, "debug_log %i/%i\n", i, DEBUG_LOG_SIZE);
debug_log_pos = 0;
#endif
+ return 0;
+}
- *eof = 1;
-done:
- if (off >= len+begin)
- return 0;
- *start = page + (off-begin);
- return ((count < begin+len-off) ? count : begin+len-off);
+static int crisv10_proc_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, crisv10_proc_show, NULL);
}
+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. */
-static void
-show_serial_version(void)
+static void show_serial_version(void)
{
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" */
}
@@ -4388,13 +4370,14 @@ static const struct tty_operations rs_ops = {
.break_ctl = rs_break,
.send_xchar = rs_send_xchar,
.wait_until_sent = rs_wait_until_sent,
- .read_proc = rs_read_proc,
.tiocmget = rs_tiocmget,
- .tiocmset = rs_tiocmset
+ .tiocmset = rs_tiocmset,
+#ifdef CONFIG_PROC_FS
+ .proc_fops = &crisv10_proc_fops,
+#endif
};
-static int __init
-rs_init(void)
+static int __init rs_init(void)
{
int i;
struct e100_serial *info;
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
next prev parent reply other threads:[~2009-04-14 7:58 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-14 7:34 linux-next: origin tree build failure Stephen Rothwell
2009-04-14 7:58 ` Jesper Nilsson [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-01-12 1:14 Stephen Rothwell
2010-01-12 1:26 ` Linus Torvalds
2010-01-12 2:32 ` Stephen Rothwell
2010-01-12 2:39 ` Stephen Rothwell
2010-01-13 0:14 ` Phillip Lougher
2010-01-13 2:55 ` Stephen Rothwell
2010-01-11 23:58 Stephen Rothwell
2010-01-12 0:29 ` Joakim Tjernlund
2010-01-12 12:38 ` Joakim Tjernlund
2009-12-24 0:54 Stephen Rothwell
2009-12-15 5:41 Stephen Rothwell
2009-12-15 8:07 ` Ingo Molnar
2009-12-15 13:01 ` Peter Ujfalusi
2009-12-15 14:53 ` Mark Brown
2009-12-15 17:27 ` Tony Lindgren
2009-12-15 22:45 ` Stephen Rothwell
2009-12-15 23:02 ` Linus Torvalds
2009-12-15 23:37 ` Stephen Rothwell
2009-12-16 9:30 ` Samuel Ortiz
2009-12-09 23:57 Stephen Rothwell
2009-11-30 23:10 Stephen Rothwell
2009-11-12 0:23 Stephen Rothwell
2009-10-09 7:50 Stephen Rothwell
2009-07-09 0:28 Stephen Rothwell
2009-06-25 1:13 Stephen Rothwell
2009-06-25 3:24 ` Baruch Siach
2009-06-25 4:12 ` Paul Mundt
2009-06-23 6:22 Stephen Rothwell
2009-06-23 10:13 ` Mark Brown
2009-06-19 6:30 Stephen Rothwell
2009-06-12 0:46 Stephen Rothwell
2009-06-12 0:24 Stephen Rothwell
2009-06-12 0:53 ` Paul Mackerras
2009-06-12 1:00 ` Benjamin Herrenschmidt
2009-06-12 9:20 ` Ingo Molnar
2009-06-12 9:33 ` Benjamin Herrenschmidt
2009-06-12 9:43 ` Peter Zijlstra
2009-06-12 9:55 ` Ingo Molnar
2009-06-12 9:57 ` Benjamin Herrenschmidt
2009-06-12 12:53 ` Ingo Molnar
2009-06-12 13:10 ` Benjamin Herrenschmidt
2009-06-12 13:29 ` Benjamin Herrenschmidt
2009-06-12 13:49 ` Ingo Molnar
2009-06-12 14:06 ` Benjamin Herrenschmidt
2009-06-12 14:11 ` Ingo Molnar
2009-06-12 14:23 ` Benjamin Herrenschmidt
2009-06-13 5:06 ` Stephen Rothwell
2009-06-12 13:44 ` Ingo Molnar
2009-06-12 13:56 ` Benjamin Herrenschmidt
2009-06-12 14:07 ` Ingo Molnar
2009-06-12 14:19 ` Benjamin Herrenschmidt
2009-06-13 4:54 ` Stephen Rothwell
2009-04-14 4:43 Stephen Rothwell
2009-04-14 8:57 ` David Miller
2009-04-14 9:20 ` Heiko Carstens
2009-04-14 9:08 ` David Miller
2009-04-14 10:26 ` Stephen Rothwell
2009-04-08 3:28 Stephen Rothwell
2009-04-08 0:10 Stephen Rothwell
2009-03-30 0:55 Stephen Rothwell
[not found] <20090112104837.69feedec.sfr@canb.auug.org.au>
2009-01-12 0:10 ` Benjamin Herrenschmidt
2009-01-12 0:10 ` Benjamin Herrenschmidt
2009-01-12 0:10 ` Benjamin Herrenschmidt
[not found] ` <1231719015.22571.4.camel@pasglop>
2009-01-12 9:05 ` Ingo Molnar
2009-01-12 9:24 ` Stephen Rothwell
2009-01-12 9:32 ` Ingo Molnar
2009-01-13 16:31 ` Stephen Rothwell
2009-01-12 9:49 ` Michael Ellerman
2009-01-12 10:44 ` Ingo Molnar
2009-01-12 10:44 ` Ingo Molnar
2009-01-12 10:44 ` Ingo Molnar
2009-01-11 23:48 Stephen Rothwell
2009-01-11 23:48 Stephen Rothwell
2009-01-11 23:48 Stephen Rothwell
2008-12-29 0:43 Stephen Rothwell
2008-12-29 3:36 ` Roland Dreier
2008-12-29 3:44 ` Roland Dreier
2008-12-29 9:58 ` Aleksey Senin
2008-12-29 0:00 Stephen Rothwell
2008-12-28 23:51 Stephen Rothwell
2008-12-28 23:38 Stephen Rothwell
2008-12-29 0:31 ` Linus Torvalds
2008-10-16 0:35 Stephen Rothwell
2008-10-16 4:57 ` David Miller
2008-10-16 0:31 Stephen Rothwell
2008-10-16 12:58 ` Ralf Baechle
2008-10-14 22:59 Stephen Rothwell
2008-10-14 23:43 ` Linus Torvalds
2008-10-14 23:52 ` David Miller
2008-10-15 0:05 ` Mark Brown
2008-10-15 0:34 ` Linus Torvalds
2008-10-14 23:51 ` Linus Torvalds
2008-10-15 9:02 ` Alan Cox
2008-10-15 9:33 ` Ingo Molnar
2008-10-15 11:01 ` Mark Brown
2008-08-26 0:37 Stephen Rothwell
2008-08-18 0:01 Stephen Rothwell
2008-08-18 12:55 ` David Howells
2008-08-18 14:03 ` James Morris
2008-07-25 0:30 Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090414075853.GA21811@axis.com \
--to=jesper.nilsson@axis.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).