From: hayoung78.joo Date: Wed, 13 Mar 2019 05:34:53 +0000 (+0900) Subject: [RAMEN9610-13205] asoc: abox: register abox log debugfs file node at system probe X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b402abd805ea7ba213cdee5f5ad391b485276304;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [RAMEN9610-13205] asoc: abox: register abox log debugfs file node at system probe Change-Id: Ib30d3a9ddabe268ef61e0904a1a000053c476f4f Signed-off-by: hayoung78.joo --- 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;