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 4/4] memory: tegra186-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
Date: Thu, 22 Sep 2022 22:33:44 +0800 [thread overview]
Message-ID: <20220922143344.3252585-5-liushixin2@huawei.com> (raw)
In-Reply-To: <20220922143344.3252585-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/tegra186-emc.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c
index 54b47ca33483..26e763bde92a 100644
--- a/drivers/memory/tegra/tegra186-emc.c
+++ b/drivers/memory/tegra/tegra186-emc.c
@@ -84,20 +84,7 @@ static int tegra186_emc_debug_available_rates_show(struct seq_file *s,
return 0;
}
-
-static int tegra186_emc_debug_available_rates_open(struct inode *inode,
- struct file *file)
-{
- return single_open(file, tegra186_emc_debug_available_rates_show,
- inode->i_private);
-}
-
-static const struct file_operations tegra186_emc_debug_available_rates_fops = {
- .open = tegra186_emc_debug_available_rates_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(tegra186_emc_debug_available_rates);
static int tegra186_emc_debug_min_rate_get(void *data, u64 *rate)
{
--
2.25.1
next prev parent reply other threads:[~2022-09-22 14:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 14:33 [PATCH 0/4] memory: tegra: Use " Liu Shixin
2022-09-22 14:33 ` [PATCH 1/4] memory: tegra20-emc: use " Liu Shixin
2022-09-22 14:33 ` [PATCH 2/4] memory: tegra30-emc: " Liu Shixin
2022-09-22 14:33 ` [PATCH 3/4] memory: tegra210-emc: " Liu Shixin
2022-09-26 9:26 ` Krzysztof Kozlowski
2022-09-26 12:37 ` Liu Shixin
2022-09-22 14:33 ` Liu Shixin [this message]
2022-09-26 9:26 ` [PATCH 0/4] memory: tegra: Use " Krzysztof Kozlowski
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=20220922143344.3252585-5-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®