X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=kernel%2Fdma.c;h=f903189c530440395417f7b873aff50e9936dc47;hb=58763a297405024d23d8f1d0bba3e6603660c4b6;hp=aef0a45b7893db2c7a5a2c94f67da7618e181bc9;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=safe%2Fjmp%2Flinux-2.6 diff --git a/kernel/dma.c b/kernel/dma.c index aef0a45..f903189 100644 --- a/kernel/dma.c +++ b/kernel/dma.c @@ -1,4 +1,4 @@ -/* $Id: dma.c,v 1.7 1994/12/28 03:35:33 root Exp root $ +/* * linux/kernel/dma.c: A DMA channel allocator. Inspired by linux/kernel/irq.c. * * Written by Hennus Bergman, 1992. @@ -20,7 +20,7 @@ #include #include - + /* A note on resource allocation: * @@ -62,6 +62,11 @@ static struct dma_chan dma_chan_busy[MAX_DMA_CHANNELS] = { }; +/** + * request_dma - request and reserve a system DMA channel + * @dmanr: DMA channel number + * @device_id: reserving device ID string, used in /proc/dma + */ int request_dma(unsigned int dmanr, const char * device_id) { if (dmanr >= MAX_DMA_CHANNELS) @@ -76,7 +81,10 @@ int request_dma(unsigned int dmanr, const char * device_id) return 0; } /* request_dma */ - +/** + * free_dma - free a reserved system DMA channel + * @dmanr: DMA channel number + */ void free_dma(unsigned int dmanr) { if (dmanr >= MAX_DMA_CHANNELS) { @@ -87,7 +95,7 @@ void free_dma(unsigned int dmanr) if (xchg(&dma_chan_busy[dmanr].lock, 0) == 0) { printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr); return; - } + } } /* free_dma */ @@ -113,8 +121,8 @@ static int proc_dma_show(struct seq_file *m, void *v) for (i = 0 ; i < MAX_DMA_CHANNELS ; i++) { if (dma_chan_busy[i].lock) { - seq_printf(m, "%2d: %s\n", i, - dma_chan_busy[i].device_id); + seq_printf(m, "%2d: %s\n", i, + dma_chan_busy[i].device_id); } } return 0; @@ -132,7 +140,7 @@ static int proc_dma_open(struct inode *inode, struct file *file) return single_open(file, proc_dma_show, NULL); } -static struct file_operations proc_dma_operations = { +static const struct file_operations proc_dma_operations = { .open = proc_dma_open, .read = seq_read, .llseek = seq_lseek, @@ -141,12 +149,7 @@ static struct file_operations proc_dma_operations = { static int __init proc_dma_init(void) { - struct proc_dir_entry *e; - - e = create_proc_entry("dma", 0, NULL); - if (e) - e->proc_fops = &proc_dma_operations; - + proc_create("dma", 0, NULL, &proc_dma_operations); return 0; }