platform/x86: samsung-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro
"Linux Kernel Mailing List" <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.head |
|---|---|
| Message-ID | <[email protected]> |
Web: https://git.kernel.org/torvalds/c/9a7c551ba7aae3648473179f234e960cfd46eaf4 Commit: 9a7c551ba7aae3648473179f234e960cfd46eaf4 Parent: 334c4efd295cda01069cab03bf753537dc20c3eb Refname: refs/heads/master Author: Andy Shevchenko <[email protected]> AuthorDate: Mon Jan 22 18:05:46 2018 +0200 Committer: Andy Shevchenko <[email protected]> CommitDate: Wed Feb 7 12:50:23 2018 +0200 platform/x86: samsung-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro ...instead of open coding file operations followed by custom ->open() callbacks per each attribute. Signed-off-by: Andy Shevchenko <[email protected]> --- drivers/platform/x86/samsung-laptop.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index d3cb26f6df73..03305e0b89ff 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c @@ -1252,7 +1252,7 @@ static int __init samsung_sysfs_init(struct samsung_laptop *samsung) } -static int show_call(struct seq_file *m, void *data) +static int samsung_laptop_call_show(struct seq_file *m, void *data) { struct samsung_laptop *samsung = m->private; struct sabi_data *sdata = &samsung->debug.data; @@ -1274,19 +1274,7 @@ static int show_call(struct seq_file *m, void *data) sdata->d0, sdata->d1, sdata->d2, sdata->d3); return 0; } - -static int samsung_debugfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, show_call, inode->i_private); -}