diff options
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch')
-rw-r--r-- | meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch | 170 |
1 files changed, 170 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch new file mode 100644 index 0000000000..93ff3205d3 --- /dev/null +++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch | |||
@@ -0,0 +1,170 @@ | |||
1 | From b47aef28536f3c276d232c41cd3084c69389dca4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tomi Valkeinen <tomi.valkeinen@nokia.com> | ||
3 | Date: Wed, 22 Apr 2009 14:11:52 +0300 | ||
4 | Subject: [PATCH] DSS2: VRAM: use debugfs, not procfs | ||
5 | |||
6 | --- | ||
7 | arch/arm/plat-omap/vram.c | 103 +++++++++++++++------------------------------ | ||
8 | 1 files changed, 34 insertions(+), 69 deletions(-) | ||
9 | |||
10 | diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c | ||
11 | index 90276ac..e847579 100644 | ||
12 | --- a/arch/arm/plat-omap/vram.c | ||
13 | +++ b/arch/arm/plat-omap/vram.c | ||
14 | @@ -27,11 +27,11 @@ | ||
15 | #include <linux/mm.h> | ||
16 | #include <linux/list.h> | ||
17 | #include <linux/dma-mapping.h> | ||
18 | -#include <linux/proc_fs.h> | ||
19 | #include <linux/seq_file.h> | ||
20 | #include <linux/bootmem.h> | ||
21 | #include <linux/omapfb.h> | ||
22 | #include <linux/completion.h> | ||
23 | +#include <linux/debugfs.h> | ||
24 | |||
25 | #include <asm/setup.h> | ||
26 | |||
27 | @@ -398,88 +398,54 @@ int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr) | ||
28 | } | ||
29 | EXPORT_SYMBOL(omap_vram_alloc); | ||
30 | |||
31 | -#ifdef CONFIG_PROC_FS | ||
32 | -static void *r_next(struct seq_file *m, void *v, loff_t *pos) | ||
33 | -{ | ||
34 | - struct list_head *l = v; | ||
35 | - | ||
36 | - (*pos)++; | ||
37 | - | ||
38 | - if (list_is_last(l, ®ion_list)) | ||
39 | - return NULL; | ||
40 | - | ||
41 | - return l->next; | ||
42 | -} | ||
43 | - | ||
44 | -static void *r_start(struct seq_file *m, loff_t *pos) | ||
45 | -{ | ||
46 | - loff_t p = *pos; | ||
47 | - struct list_head *l = ®ion_list; | ||
48 | - | ||
49 | - mutex_lock(®ion_mutex); | ||
50 | - | ||
51 | - do { | ||
52 | - l = l->next; | ||
53 | - if (l == ®ion_list) | ||
54 | - return NULL; | ||
55 | - } while (p--); | ||
56 | - | ||
57 | - return l; | ||
58 | -} | ||
59 | - | ||
60 | -static void r_stop(struct seq_file *m, void *v) | ||
61 | -{ | ||
62 | - mutex_unlock(®ion_mutex); | ||
63 | -} | ||
64 | - | ||
65 | -static int r_show(struct seq_file *m, void *v) | ||
66 | +#if defined(CONFIG_DEBUG_FS) | ||
67 | +static int vram_debug_show(struct seq_file *s, void *unused) | ||
68 | { | ||
69 | struct vram_region *vr; | ||
70 | struct vram_alloc *va; | ||
71 | unsigned size; | ||
72 | |||
73 | - vr = list_entry(v, struct vram_region, list); | ||
74 | - | ||
75 | - size = vr->pages << PAGE_SHIFT; | ||
76 | - | ||
77 | - seq_printf(m, "%08lx-%08lx (%d bytes)\n", | ||
78 | - vr->paddr, vr->paddr + size - 1, | ||
79 | - size); | ||
80 | + mutex_lock(®ion_mutex); | ||
81 | |||
82 | - list_for_each_entry(va, &vr->alloc_list, list) { | ||
83 | - size = va->pages << PAGE_SHIFT; | ||
84 | - seq_printf(m, " %08lx-%08lx (%d bytes)\n", | ||
85 | - va->paddr, va->paddr + size - 1, | ||
86 | + list_for_each_entry(vr, ®ion_list, list) { | ||
87 | + size = vr->pages << PAGE_SHIFT; | ||
88 | + seq_printf(s, "%08lx-%08lx (%d bytes)\n", | ||
89 | + vr->paddr, vr->paddr + size - 1, | ||
90 | size); | ||
91 | - } | ||
92 | |||
93 | + list_for_each_entry(va, &vr->alloc_list, list) { | ||
94 | + size = va->pages << PAGE_SHIFT; | ||
95 | + seq_printf(s, " %08lx-%08lx (%d bytes)\n", | ||
96 | + va->paddr, va->paddr + size - 1, | ||
97 | + size); | ||
98 | + } | ||
99 | + } | ||
100 | |||
101 | + mutex_unlock(®ion_mutex); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | -static const struct seq_operations resource_op = { | ||
107 | - .start = r_start, | ||
108 | - .next = r_next, | ||
109 | - .stop = r_stop, | ||
110 | - .show = r_show, | ||
111 | -}; | ||
112 | - | ||
113 | -static int vram_open(struct inode *inode, struct file *file) | ||
114 | +static int vram_debug_open(struct inode *inode, struct file *file) | ||
115 | { | ||
116 | - return seq_open(file, &resource_op); | ||
117 | + return single_open(file, vram_debug_show, inode->i_private); | ||
118 | } | ||
119 | |||
120 | -static const struct file_operations proc_vram_operations = { | ||
121 | - .open = vram_open, | ||
122 | - .read = seq_read, | ||
123 | - .llseek = seq_lseek, | ||
124 | - .release = seq_release, | ||
125 | +static const struct file_operations vram_debug_fops = { | ||
126 | + .open = vram_debug_open, | ||
127 | + .read = seq_read, | ||
128 | + .llseek = seq_lseek, | ||
129 | + .release = single_release, | ||
130 | }; | ||
131 | |||
132 | -static int __init omap_vram_create_proc(void) | ||
133 | +static int __init omap_vram_create_debugfs(void) | ||
134 | { | ||
135 | - proc_create("omap-vram", 0, NULL, &proc_vram_operations); | ||
136 | + struct dentry *d; | ||
137 | + | ||
138 | + d = debugfs_create_file("vram", S_IRUGO, NULL, | ||
139 | + NULL, &vram_debug_fops); | ||
140 | + if (IS_ERR(d)) | ||
141 | + return PTR_ERR(d); | ||
142 | |||
143 | return 0; | ||
144 | } | ||
145 | @@ -487,7 +453,7 @@ static int __init omap_vram_create_proc(void) | ||
146 | |||
147 | static __init int omap_vram_init(void) | ||
148 | { | ||
149 | - int i, r; | ||
150 | + int i; | ||
151 | |||
152 | vram_initialized = 1; | ||
153 | |||
154 | @@ -495,10 +461,9 @@ static __init int omap_vram_init(void) | ||
155 | omap_vram_add_region(postponed_regions[i].paddr, | ||
156 | postponed_regions[i].size); | ||
157 | |||
158 | -#ifdef CONFIG_PROC_FS | ||
159 | - r = omap_vram_create_proc(); | ||
160 | - if (r) | ||
161 | - return -ENOMEM; | ||
162 | +#ifdef CONFIG_DEBUG_FS | ||
163 | + if (omap_vram_create_debugfs()) | ||
164 | + pr_err("VRAM: Failed to create debugfs file\n"); | ||
165 | #endif | ||
166 | |||
167 | return 0; | ||
168 | -- | ||
169 | 1.5.6.5 | ||
170 | |||