[RAMEN9610-13205] asoc: abox: register abox log debugfs file node at system probe
authorhayoung78.joo <hayoung78.joo@samsung.com>
Wed, 13 Mar 2019 05:34:53 +0000 (14:34 +0900)
committerhskang <hs1218.kang@samsung.com>
Wed, 13 Mar 2019 13:21:58 +0000 (22:21 +0900)
Change-Id: Ib30d3a9ddabe268ef61e0904a1a000053c476f4f
Signed-off-by: hayoung78.joo <hayoung78.joo@samsung.com>
sound/soc/samsung/abox/abox_log.c

index ae6942bf4eda52f0307a6468757404e52202803f..2c88d386ad8bfb5f78f9c117669398500681108f 100644 (file)
@@ -306,6 +306,7 @@ static const struct file_operations abox_log_fops = {
        .owner = THIS_MODULE,
 };
 
+static struct abox_log_buffer_info abox_log_buffer_info_default;
 static struct abox_log_buffer_info abox_log_buffer_info_new;
 
 void abox_log_register_buffer_work_func(struct work_struct *work)
@@ -314,7 +315,6 @@ void abox_log_register_buffer_work_func(struct work_struct *work)
        int id;
        struct ABOX_LOG_BUFFER *buffer;
        struct abox_log_buffer_info *info;
-       char name[16];
 
        dev = abox_log_buffer_info_new.dev;
        id = abox_log_buffer_info_new.id;
@@ -325,7 +325,7 @@ void abox_log_register_buffer_work_func(struct work_struct *work)
 
        dev_info(dev, "%s(%p, %d, %p)\n", __func__, dev, id, buffer);
 
-       info = vmalloc(sizeof(*info));
+       info = &abox_log_buffer_info_default;
        mutex_init(&info->lock);
        info->id = id;
        info->file_created = false;
@@ -336,10 +336,6 @@ void abox_log_register_buffer_work_func(struct work_struct *work)
        info->dev = dev;
        info->log_buffer = buffer;
        list_add_tail(&info->list, &abox_log_list_head);
-
-       snprintf(name, sizeof(name), "log-%02d", id);
-       debugfs_create_file(name, 0664, abox_dbg_get_root_dir(), info,
-                       &abox_log_fops);
 }
 
 static DECLARE_WORK(abox_log_register_buffer_work,
@@ -414,6 +410,8 @@ static int __init samsung_abox_log_late_initcall(void)
        debugfs_create_u32("log_auto_save", S_IRWUG, abox_dbg_get_root_dir(),
                        &abox_log_auto_save);
 
+       debugfs_create_file("log-00", 0664, abox_dbg_get_root_dir(),
+                       &abox_log_buffer_info_default, &abox_log_fops);
 #ifdef TEST
        abox_log_test_buffer = vzalloc(SZ_128);
        abox_log_test_buffer->size = SZ_64;