From: Alex Elder Date: Wed, 28 Oct 2015 03:18:40 +0000 (-0500) Subject: greybus: es2: move logging dentries into es2 struct X-Git-Tag: v4.9.8~1233^2~378^2~21^2~1085 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbec7e2919f04d3d1abea1cde93a8052e2e8ef04;p=platform%2Fkernel%2Flinux-rpi3.git greybus: es2: move logging dentries into es2 struct Finish moving the logging data structures into the es2 AP data structure rather than having it be a single global. This patch moves the two dentries related to logging. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index 3de5ba19..fc3930f 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -29,8 +29,6 @@ static const struct usb_device_id id_table[] = { MODULE_DEVICE_TABLE(usb, id_table); #define APB1_LOG_SIZE SZ_16K -static struct dentry *apb1_log_dentry; -static struct dentry *apb1_log_enable_dentry; /* Number of bulk in and bulk out couple */ #define NUM_BULKS 7 @@ -97,6 +95,8 @@ struct es2_cport_out { * @cport_out_urb_lock: locks the @cport_out_urb_busy "list" * * @apb1_log_task: task pointer for logging thread + * @apb1_log_dentry: file system entry for the log file interface + * @apb1_log_enable_dentry: file system entry for enabling logging * @apb1_log_fifo: kernel FIFO to carry logged data */ struct es2_ap_dev { @@ -114,6 +114,8 @@ struct es2_ap_dev { int *cport_to_ep; struct task_struct *apb1_log_task; + struct dentry *apb1_log_dentry; + struct dentry *apb1_log_enable_dentry; DECLARE_KFIFO(apb1_log_fifo, char, APB1_LOG_SIZE); }; @@ -689,7 +691,7 @@ static void usb_log_enable(struct es2_ap_dev *es2) es2->apb1_log_task = kthread_run(apb1_log_poll, es2, "apb1_log"); if (IS_ERR(es2->apb1_log_task)) return; - apb1_log_dentry = debugfs_create_file("apb1_log", S_IRUGO, + es2->apb1_log_dentry = debugfs_create_file("apb1_log", S_IRUGO, gb_debugfs_get(), NULL, &apb1_log_fops); } @@ -699,8 +701,8 @@ static void usb_log_disable(struct es2_ap_dev *es2) if (IS_ERR_OR_NULL(es2->apb1_log_task)) return; - debugfs_remove(apb1_log_dentry); - apb1_log_dentry = NULL; + debugfs_remove(es2->apb1_log_dentry); + es2->apb1_log_dentry = NULL; kthread_stop(es2->apb1_log_task); es2->apb1_log_task = NULL; @@ -890,7 +892,7 @@ static int ap_probe(struct usb_interface *interface, es2->cport_out_urb_busy[i] = false; /* just to be anal */ } - apb1_log_enable_dentry = debugfs_create_file("apb1_log_enable", + es2->apb1_log_enable_dentry = debugfs_create_file("apb1_log_enable", (S_IWUSR | S_IRUGO), gb_debugfs_get(), es2, &apb1_log_enable_fops);