From: Liu Shixin <liushixin2@huawei.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
Liu Shixin <liushixin2@huawei.com>
Subject: [PATCH v2 1/4] memory: tegra20-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
Date: Mon, 26 Sep 2022 21:00:22 +0800 [thread overview]
Message-ID: <20220926130025.1061373-2-liushixin2@huawei.com> (raw)
In-Reply-To: <20220926130025.1061373-1-liushixin2@huawei.com>
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
drivers/memory/tegra/tegra20-emc.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c
index 25ba3c5e4ad6..bd4e37b6552d 100644
--- a/drivers/memory/tegra/tegra20-emc.c
+++ b/drivers/memory/tegra/tegra20-emc.c
@@ -841,20 +841,7 @@ static int tegra_emc_debug_available_rates_show(struct seq_file *s, void *data)
return 0;
}
-
-static int tegra_emc_debug_available_rates_open(struct inode *inode,
- struct file *file)
-{
- return single_open(file, tegra_emc_debug_available_rates_show,
- inode->i_private);
-}
-
-static const struct file_operations tegra_emc_debug_available_rates_fops = {
- .open = tegra_emc_debug_available_rates_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(tegra_emc_debug_available_rates);
static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
{
--
2.25.1
next prev parent reply other threads:[~2022-09-26 14:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 13:00 [PATCH v2 0/4] memory: tegra: Use " Liu Shixin
2022-09-26 13:00 ` Liu Shixin [this message]
2022-09-26 13:00 ` [PATCH v2 2/4] memory: tegra30-emc: use " Liu Shixin
2022-09-26 13:00 ` [PATCH v2 3/4] memory: tegra210-emc: " Liu Shixin
2022-09-26 13:00 ` [PATCH v2 4/4] memory: tegra186-emc: " Liu Shixin
2022-09-28 9:02 ` [PATCH v2 0/4] memory: tegra: Use " Krzysztof Kozlowski
2022-10-24 13:10 ` Thierry Reding
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=20220926130025.1061373-2-liushixin2@huawei.com \
--to=liushixin2@huawei.com \
--cc=jonathanh@nvidia.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/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
all inboxes | Powered by JetHome®