2018-11-23 19:14:51

by Frank Lee

[permalink] [raw]
Subject: [PATCH] firmware: ti_sci: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/firmware/ti_sci.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 69ed1464175c..3fbbb61012c4 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -146,25 +146,8 @@ static int ti_sci_debug_show(struct seq_file *s, void *unused)
return 0;
}

-/**
- * ti_sci_debug_open() - debug file open
- * @inode: inode pointer
- * @file: file pointer
- *
- * Return: result of single_open
- */
-static int ti_sci_debug_open(struct inode *inode, struct file *file)
-{
- return single_open(file, ti_sci_debug_show, inode->i_private);
-}
-
-/* log file operations */
-static const struct file_operations ti_sci_debug_fops = {
- .open = ti_sci_debug_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+/* Provide the log file operations interface*/
+DEFINE_SHOW_ATTRIBUTE(ti_sci_debug);

/**
* ti_sci_debugfs_create() - Create log debug file
--
2.17.0



2018-12-08 16:05:09

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH] firmware: ti_sci: Change to use DEFINE_SHOW_ATTRIBUTE macro

On 09:05-20181122, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Yangtao Li <[email protected]>

Thanks for the same and sorry for responding so late.

[...]

Santosh,
could you pick this up? maybe for next rev or so?

Reviewed-by: Nishanth Menon <[email protected]>

--
Regards,
Nishanth Menon

2018-12-09 04:27:42

by Santosh Shilimkar

[permalink] [raw]
Subject: Re: [PATCH] firmware: ti_sci: Change to use DEFINE_SHOW_ATTRIBUTE macro

On 12/8/2018 8:04 AM, Nishanth Menon wrote:
> On 09:05-20181122, Yangtao Li wrote:
>> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>>
>> Signed-off-by: Yangtao Li <[email protected]>
>
> Thanks for the same and sorry for responding so late.
>
> [...]
>
> Santosh,
> could you pick this up? maybe for next rev or so?
>
> Reviewed-by: Nishanth Menon <[email protected]>
>
Sure !!