RISC-V: fixups to work with crash tool
[linux-2.6-microblaze.git] / drivers / android / binderfs.c
index 6c5e94f..588d753 100644 (file)
@@ -629,6 +629,7 @@ static int init_binder_features(struct super_block *sb)
 static int init_binder_logs(struct super_block *sb)
 {
        struct dentry *binder_logs_root_dir, *dentry, *proc_log_dir;
+       const struct binder_debugfs_entry *db_entry;
        struct binderfs_info *info;
        int ret = 0;
 
@@ -639,43 +640,15 @@ static int init_binder_logs(struct super_block *sb)
                goto out;
        }
 
-       dentry = binderfs_create_file(binder_logs_root_dir, "stats",
-                                     &binder_stats_fops, NULL);
-       if (IS_ERR(dentry)) {
-               ret = PTR_ERR(dentry);
-               goto out;
-       }
-
-       dentry = binderfs_create_file(binder_logs_root_dir, "state",
-                                     &binder_state_fops, NULL);
-       if (IS_ERR(dentry)) {
-               ret = PTR_ERR(dentry);
-               goto out;
-       }
-
-       dentry = binderfs_create_file(binder_logs_root_dir, "transactions",
-                                     &binder_transactions_fops, NULL);
-       if (IS_ERR(dentry)) {
-               ret = PTR_ERR(dentry);
-               goto out;
-       }
-
-       dentry = binderfs_create_file(binder_logs_root_dir,
-                                     "transaction_log",
-                                     &binder_transaction_log_fops,
-                                     &binder_transaction_log);
-       if (IS_ERR(dentry)) {
-               ret = PTR_ERR(dentry);
-               goto out;
-       }
-
-       dentry = binderfs_create_file(binder_logs_root_dir,
-                                     "failed_transaction_log",
-                                     &binder_transaction_log_fops,
-                                     &binder_transaction_log_failed);
-       if (IS_ERR(dentry)) {
-               ret = PTR_ERR(dentry);
-               goto out;
+       binder_for_each_debugfs_entry(db_entry) {
+               dentry = binderfs_create_file(binder_logs_root_dir,
+                                             db_entry->name,
+                                             db_entry->fops,
+                                             db_entry->data);
+               if (IS_ERR(dentry)) {
+                       ret = PTR_ERR(dentry);
+                       goto out;
+               }
        }
 
        proc_log_dir = binderfs_create_dir(binder_logs_root_dir, "proc");