Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

memory: tegra186-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220926130025.1061373-5-liushixin2@huawei.com

authored by

Liu Shixin and committed by
Krzysztof Kozlowski
58504acd 47f37785

+1 -14
+1 -14
drivers/memory/tegra/tegra186-emc.c
··· 84 84 85 85 return 0; 86 86 } 87 - 88 - static int tegra186_emc_debug_available_rates_open(struct inode *inode, 89 - struct file *file) 90 - { 91 - return single_open(file, tegra186_emc_debug_available_rates_show, 92 - inode->i_private); 93 - } 94 - 95 - static const struct file_operations tegra186_emc_debug_available_rates_fops = { 96 - .open = tegra186_emc_debug_available_rates_open, 97 - .read = seq_read, 98 - .llseek = seq_lseek, 99 - .release = single_release, 100 - }; 87 + DEFINE_SHOW_ATTRIBUTE(tegra186_emc_debug_available_rates); 101 88 102 89 static int tegra186_emc_debug_min_rate_get(void *data, u64 *rate) 103 90 {