aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/memory/emif.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index 1424ae38e53b..06d31c99e6ac 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -75,6 +75,7 @@ static unsigned long irq_state;
75static u32 t_ck; /* DDR clock period in ps */ 75static u32 t_ck; /* DDR clock period in ps */
76static LIST_HEAD(device_list); 76static LIST_HEAD(device_list);
77 77
78#ifdef CONFIG_DEBUG_FS
78static void do_emif_regdump_show(struct seq_file *s, struct emif_data *emif, 79static void do_emif_regdump_show(struct seq_file *s, struct emif_data *emif,
79 struct emif_regs *regs) 80 struct emif_regs *regs)
80{ 81{
@@ -166,23 +167,23 @@ static int __init_or_module emif_debugfs_init(struct emif_data *emif)
166 int ret; 167 int ret;
167 168
168 dentry = debugfs_create_dir(dev_name(emif->dev), NULL); 169 dentry = debugfs_create_dir(dev_name(emif->dev), NULL);
169 if (IS_ERR(dentry)) { 170 if (!dentry) {
170 ret = PTR_ERR(dentry); 171 ret = -ENOMEM;
171 goto err0; 172 goto err0;
172 } 173 }
173 emif->debugfs_root = dentry; 174 emif->debugfs_root = dentry;
174 175
175 dentry = debugfs_create_file("regcache_dump", S_IRUGO, 176 dentry = debugfs_create_file("regcache_dump", S_IRUGO,
176 emif->debugfs_root, emif, &emif_regdump_fops); 177 emif->debugfs_root, emif, &emif_regdump_fops);
177 if (IS_ERR(dentry)) { 178 if (!dentry) {
178 ret = PTR_ERR(dentry); 179 ret = -ENOMEM;
179 goto err1; 180 goto err1;
180 } 181 }
181 182
182 dentry = debugfs_create_file("mr4", S_IRUGO, 183 dentry = debugfs_create_file("mr4", S_IRUGO,
183 emif->debugfs_root, emif, &emif_mr4_fops); 184 emif->debugfs_root, emif, &emif_mr4_fops);
184 if (IS_ERR(dentry)) { 185 if (!dentry) {
185 ret = PTR_ERR(dentry); 186 ret = -ENOMEM;
186 goto err1; 187 goto err1;
187 } 188 }
188 189
@@ -198,6 +199,16 @@ static void __exit emif_debugfs_exit(struct emif_data *emif)
198 debugfs_remove_recursive(emif->debugfs_root); 199 debugfs_remove_recursive(emif->debugfs_root);
199 emif->debugfs_root = NULL; 200 emif->debugfs_root = NULL;
200} 201}
202#else
203static inline int __init_or_module emif_debugfs_init(struct emif_data *emif)
204{
205 return 0;
206}
207
208static inline void __exit emif_debugfs_exit(struct emif_data *emif)
209{
210}
211#endif
201 212
202/* 213/*
203 * Calculate the period of DDR clock from frequency value 214 * Calculate the period of DDR clock from frequency value