From: tip-bot for Andy Shevchenko <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, peterz@infradead.org,
linux-kernel@vger.kernel.org, hpa@zytor.com,
torvalds@linux-foundation.org, andriy.shevchenko@linux.intel.com,
mingo@kernel.org
Subject: [tip:x86/platform] x86/platform/quark: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Date: Fri, 16 Feb 2018 01:47:59 -0800 [thread overview]
Message-ID: <tip-a66b86f0026b07b0ea7340e3690ac9fd5ac1499a@git.kernel.org> (raw)
In-Reply-To: <20180214154317.52290-2-andriy.shevchenko@linux.intel.com>
Commit-ID: a66b86f0026b07b0ea7340e3690ac9fd5ac1499a
Gitweb: https://git.kernel.org/tip/a66b86f0026b07b0ea7340e3690ac9fd5ac1499a
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate: Wed, 14 Feb 2018 17:43:17 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 16 Feb 2018 10:10:14 +0100
x86/platform/quark: Re-use DEFINE_SHOW_ATTRIBUTE() macro
...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.
While here, replace permissions by explicit octal value.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180214154317.52290-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/platform/intel-quark/imr.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/arch/x86/platform/intel-quark/imr.c b/arch/x86/platform/intel-quark/imr.c
index 17d6d22..49828c2 100644
--- a/arch/x86/platform/intel-quark/imr.c
+++ b/arch/x86/platform/intel-quark/imr.c
@@ -224,25 +224,7 @@ static int imr_dbgfs_state_show(struct seq_file *s, void *unused)
mutex_unlock(&idev->lock);
return ret;
}
-
-/**
- * imr_state_open - debugfs open callback.
- *
- * @inode: pointer to struct inode.
- * @file: pointer to struct file.
- * @return: result of single open.
- */
-static int imr_state_open(struct inode *inode, struct file *file)
-{
- return single_open(file, imr_dbgfs_state_show, inode->i_private);
-}
-
-static const struct file_operations imr_state_ops = {
- .open = imr_state_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(imr_dbgfs_state);
/**
* imr_debugfs_register - register debugfs hooks.
@@ -252,8 +234,8 @@ static const struct file_operations imr_state_ops = {
*/
static int imr_debugfs_register(struct imr_device *idev)
{
- idev->file = debugfs_create_file("imr_state", S_IFREG | S_IRUGO, NULL,
- idev, &imr_state_ops);
+ idev->file = debugfs_create_file("imr_state", 0444, NULL, idev,
+ &imr_dbgfs_state_fops);
return PTR_ERR_OR_ZERO(idev->file);
}
next prev parent reply other threads:[~2018-02-16 9:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 15:43 [PATCH v1 1/2] x86/platform/atom: " Andy Shevchenko
2018-02-14 15:43 ` [PATCH v1 2/2] x86/platform/quark: " Andy Shevchenko
2018-02-16 9:47 ` tip-bot for Andy Shevchenko [this message]
2018-02-16 9:10 ` [PATCH v1 1/2] x86/platform/atom: " Ingo Molnar
2018-02-16 9:41 ` Andy Shevchenko
2018-02-16 9:47 ` [tip:x86/platform] " tip-bot for Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-a66b86f0026b07b0ea7340e3690ac9fd5ac1499a@git.kernel.org \
--to=tipbot@zytor.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome