From nobody Thu Apr 2 18:14:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09B9BC07E9D for ; Mon, 26 Sep 2022 14:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234478AbiIZORt (ORCPT ); Mon, 26 Sep 2022 10:17:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234293AbiIZORO (ORCPT ); Mon, 26 Sep 2022 10:17:14 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F41187689; Mon, 26 Sep 2022 05:27:18 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MbhjK0Dc4z1P6vW; Mon, 26 Sep 2022 20:22:45 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 26 Sep 2022 20:26:58 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 26 Sep 2022 20:26:58 +0800 From: Liu Shixin To: Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter CC: , , Liu Shixin Subject: [PATCH v2 3/4] memory: tegra210-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code Date: Mon, 26 Sep 2022 21:00:24 +0800 Message-ID: <20220926130025.1061373-4-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220926130025.1061373-1-liushixin2@huawei.com> References: <20220926130025.1061373-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin --- drivers/memory/tegra/tegra210-emc-core.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegr= a/tegra210-emc-core.c index cbe1a7723514..ae5f982f861b 100644 --- a/drivers/memory/tegra/tegra210-emc-core.c +++ b/drivers/memory/tegra/tegra210-emc-core.c @@ -1621,20 +1621,7 @@ static int tegra210_emc_debug_available_rates_show(s= truct seq_file *s, =20 return 0; } - -static int tegra210_emc_debug_available_rates_open(struct inode *inode, - struct file *file) -{ - return single_open(file, tegra210_emc_debug_available_rates_show, - inode->i_private); -} - -static const struct file_operations tegra210_emc_debug_available_rates_fop= s =3D { - .open =3D tegra210_emc_debug_available_rates_open, - .read =3D seq_read, - .llseek =3D seq_lseek, - .release =3D single_release, -}; +DEFINE_SHOW_ATTRIBUTE(tegra210_emc_debug_available_rates); =20 static int tegra210_emc_debug_min_rate_get(void *data, u64 *rate) { --=20 2.25.1