From b402abd805ea7ba213cdee5f5ad391b485276304 Mon Sep 17 00:00:00 2001 From: "hayoung78.joo" Date: Wed, 13 Mar 2019 14:34:53 +0900 Subject: [PATCH] [RAMEN9610-13205] asoc: abox: register abox log debugfs file node at system probe Change-Id: Ib30d3a9ddabe268ef61e0904a1a000053c476f4f Signed-off-by: hayoung78.joo --- sound/soc/samsung/abox/abox_log.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/samsung/abox/abox_log.c b/sound/soc/samsung/abox/abox_log.c index ae6942bf4eda..2c88d386ad8b 100644 --- a/sound/soc/samsung/abox/abox_log.c +++ b/sound/soc/samsung/abox/abox_log.c @@ -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; -- 2.20.1