diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-01-19 05:14:37 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-19 05:14:37 -0800 |
| commit | 489a867c51086cadf495bc6aa0839ef090fa740f (patch) | |
| tree | f6acda8b2f8c288c10789bc4366dc475d9c921a6 /kernel/dma.c | |
| parent | efe067fac0fcd767a4dbe3c52d7548d43499c5c4 (diff) | |
[PATCH] cleanup single_open usage in dma.c
From: Jeff Muizelaar <muizelaar@rogers.com>
The attached patch lets the seq_file api take care of buffer allocation
instead of doing it by hand.
Diffstat (limited to 'kernel/dma.c')
| -rw-r--r-- | kernel/dma.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/kernel/dma.c b/kernel/dma.c index 7ad7fbf83a83..af1d982a0c57 100644 --- a/kernel/dma.c +++ b/kernel/dma.c @@ -136,20 +136,7 @@ static int proc_dma_show(struct seq_file *m, void *v) static int proc_dma_open(struct inode *inode, struct file *file) { - char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); - struct seq_file *m; - int res; - - if (!buf) - return -ENOMEM; - res = single_open(file, proc_dma_show, NULL); - if (!res) { - m = file->private_data; - m->buf = buf; - m->size = PAGE_SIZE; - } else - kfree(buf); - return res; + return single_open(file, proc_dma_show, NULL); } static struct file_operations proc_dma_operations = { |
