aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-08-28 14:19:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-11-18 06:50:51 -0500
commita1afb6371bb5341057056194d1168753f6d77242 (patch)
treedd120dd5fa3c58319d87ba1e8d28ec37986dfce2
parentc82a43d40b93200a10a9fec0a489791e65e135ca (diff)
genirq: switch /proc/irq/*/spurious to seq_file
[ tglx: compacted it a bit ] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> LKML-Reference: <20090828181743.GA14050@x200.localdomain> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/irq/proc.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index dfef5b9f3845..4e47f11da6a7 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -148,18 +148,28 @@ static const struct file_operations default_affinity_proc_fops = {
148}; 148};
149#endif 149#endif
150 150
151static int irq_spurious_read(char *page, char **start, off_t off, 151static int irq_spurious_proc_show(struct seq_file *m, void *v)
152 int count, int *eof, void *data)
153{ 152{
154 struct irq_desc *desc = irq_to_desc((long) data); 153 struct irq_desc *desc = irq_to_desc((long) m->private);
155 return sprintf(page, "count %u\n" 154
156 "unhandled %u\n" 155 seq_printf(m, "count %u\n" "unhandled %u\n" "last_unhandled %u ms\n",
157 "last_unhandled %u ms\n", 156 desc->irq_count, desc->irqs_unhandled,
158 desc->irq_count, 157 jiffies_to_msecs(desc->last_unhandled));
159 desc->irqs_unhandled, 158 return 0;
160 jiffies_to_msecs(desc->last_unhandled)); 159}
160
161static int irq_spurious_proc_open(struct inode *inode, struct file *file)
162{
163 return single_open(file, irq_spurious_proc_show, NULL);
161} 164}
162 165
166static const struct file_operations irq_spurious_proc_fops = {
167 .open = irq_spurious_proc_open,
168 .read = seq_read,
169 .llseek = seq_lseek,
170 .release = single_release,
171};
172
163#define MAX_NAMELEN 128 173#define MAX_NAMELEN 128
164 174
165static int name_unique(unsigned int irq, struct irqaction *new_action) 175static int name_unique(unsigned int irq, struct irqaction *new_action)
@@ -204,7 +214,6 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
204void register_irq_proc(unsigned int irq, struct irq_desc *desc) 214void register_irq_proc(unsigned int irq, struct irq_desc *desc)
205{ 215{
206 char name [MAX_NAMELEN]; 216 char name [MAX_NAMELEN];
207 struct proc_dir_entry *entry;
208 217
209 if (!root_irq_dir || (desc->chip == &no_irq_chip) || desc->dir) 218 if (!root_irq_dir || (desc->chip == &no_irq_chip) || desc->dir)
210 return; 219 return;
@@ -223,11 +232,8 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)
223 &irq_affinity_proc_fops, (void *)(long)irq); 232 &irq_affinity_proc_fops, (void *)(long)irq);
224#endif 233#endif
225 234
226 entry = create_proc_entry("spurious", 0444, desc->dir); 235 proc_create_data("spurious", 0444, desc->dir,
227 if (entry) { 236 &irq_spurious_proc_fops, (void *)(long)irq);
228 entry->data = (void *)(long)irq;
229 entry->read_proc = irq_spurious_read;
230 }
231} 237}
232 238
233#undef MAX_NAMELEN 239#undef MAX_NAMELEN