提交 64f0962c 编写于 作者: D David Howells 提交者: Al Viro

sh: Don't use create_proc_read_entry()

Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.
Signed-off-by: NDavid Howells <dhowells@redhat.com>
cc: Paul Mundt <lethal@linux-sh.org>
cc: linux-sh@vger.kernel.org
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 c7f079ca
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -308,11 +309,9 @@ int dma_extend(unsigned int chan, unsigned long op, void *param) ...@@ -308,11 +309,9 @@ int dma_extend(unsigned int chan, unsigned long op, void *param)
} }
EXPORT_SYMBOL(dma_extend); EXPORT_SYMBOL(dma_extend);
static int dma_read_proc(char *buf, char **start, off_t off, static int dma_proc_show(struct seq_file *m, void *v)
int len, int *eof, void *data)
{ {
struct dma_info *info; struct dma_info *info = v;
char *p = buf;
if (list_empty(&registered_dmac_list)) if (list_empty(&registered_dmac_list))
return 0; return 0;
...@@ -332,14 +331,26 @@ static int dma_read_proc(char *buf, char **start, off_t off, ...@@ -332,14 +331,26 @@ static int dma_read_proc(char *buf, char **start, off_t off,
if (!(channel->flags & DMA_CONFIGURED)) if (!(channel->flags & DMA_CONFIGURED))
continue; continue;
p += sprintf(p, "%2d: %14s %s\n", i, seq_printf(m, "%2d: %14s %s\n", i,
info->name, channel->dev_id); info->name, channel->dev_id);
} }
} }
return p - buf; return 0;
}
static int dma_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, dma_proc_show, NULL);
} }
static const struct file_operations dma_proc_fops = {
.open = dma_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
int register_dmac(struct dma_info *info) int register_dmac(struct dma_info *info)
{ {
unsigned int total_channels, i; unsigned int total_channels, i;
...@@ -412,8 +423,7 @@ EXPORT_SYMBOL(unregister_dmac); ...@@ -412,8 +423,7 @@ EXPORT_SYMBOL(unregister_dmac);
static int __init dma_api_init(void) static int __init dma_api_init(void)
{ {
printk(KERN_NOTICE "DMA: Registering DMA API.\n"); printk(KERN_NOTICE "DMA: Registering DMA API.\n");
return create_proc_read_entry("dma", 0, 0, dma_read_proc, 0) return proc_create("dma", 0, NULL, &dma_proc_fops) ? 0 : -ENOMEM;
? 0 : -ENOMEM;
} }
subsys_initcall(dma_api_init); subsys_initcall(dma_api_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册