aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-davinci/clock.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 2c27caefa62e..a19bab18318a 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -459,24 +459,10 @@ int __init davinci_clk_init(struct davinci_clk *clocks)
459 return 0; 459 return 0;
460} 460}
461 461
462#ifdef CONFIG_PROC_FS 462#ifdef CONFIG_DEBUG_FS
463#include <linux/proc_fs.h>
464#include <linux/seq_file.h>
465
466static void *davinci_ck_start(struct seq_file *m, loff_t *pos)
467{
468 return *pos < 1 ? (void *)1 : NULL;
469}
470
471static void *davinci_ck_next(struct seq_file *m, void *v, loff_t *pos)
472{
473 ++*pos;
474 return NULL;
475}
476 463
477static void davinci_ck_stop(struct seq_file *m, void *v) 464#include <linux/debugfs.h>
478{ 465#include <linux/seq_file.h>
479}
480 466
481#define CLKNAME_MAX 10 /* longest clock name */ 467#define CLKNAME_MAX 10 /* longest clock name */
482#define NEST_DELTA 2 468#define NEST_DELTA 2
@@ -530,30 +516,24 @@ static int davinci_ck_show(struct seq_file *m, void *v)
530 return 0; 516 return 0;
531} 517}
532 518
533static const struct seq_operations davinci_ck_op = {
534 .start = davinci_ck_start,
535 .next = davinci_ck_next,
536 .stop = davinci_ck_stop,
537 .show = davinci_ck_show
538};
539
540static int davinci_ck_open(struct inode *inode, struct file *file) 519static int davinci_ck_open(struct inode *inode, struct file *file)
541{ 520{
542 return seq_open(file, &davinci_ck_op); 521 return single_open(file, davinci_ck_show, NULL);
543} 522}
544 523
545static const struct file_operations proc_davinci_ck_operations = { 524static const struct file_operations davinci_ck_operations = {
546 .open = davinci_ck_open, 525 .open = davinci_ck_open,
547 .read = seq_read, 526 .read = seq_read,
548 .llseek = seq_lseek, 527 .llseek = seq_lseek,
549 .release = seq_release, 528 .release = single_release,
550}; 529};
551 530
552static int __init davinci_ck_proc_init(void) 531static int __init davinci_clk_debugfs_init(void)
553{ 532{
554 proc_create("davinci_clocks", 0, NULL, &proc_davinci_ck_operations); 533 debugfs_create_file("davinci_clocks", S_IFREG | S_IRUGO, NULL, NULL,
534 &davinci_ck_operations);
555 return 0; 535 return 0;
556 536
557} 537}
558__initcall(davinci_ck_proc_init); 538device_initcall(davinci_clk_debugfs_init);
559#endif /* CONFIG_DEBUG_PROC_FS */ 539#endif /* CONFIG_DEBUG_FS */