Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6333355rwn; Tue, 13 Sep 2022 02:39:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6mBVqm1niOxnuGeIkMujSPCx0viss4w8X54bG0/MANxq0kcGGjZVueggNIuj6P5+e7Mdeu X-Received: by 2002:a05:6402:1ccf:b0:447:2a20:254f with SMTP id ds15-20020a0564021ccf00b004472a20254fmr25110212edb.114.1663061943698; Tue, 13 Sep 2022 02:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663061943; cv=none; d=google.com; s=arc-20160816; b=FU6BM8Obg7kAZDbaWMyAlCcGqdIiVPX9Cx89qxuJ/3VRsOa/acNpBawaA4Jky0HeQ/ SEZ4UkFDhlhZUJ9vPb69/P7rPJcy+ND31irq9jVCub2L6sip7QEF46l4TJYMRPLiF+9m fFmoPWq/+Z+kAz8CKHOBdhqEDw59gnH9jNbHbHTohq3Fv2uQSjK+AxrhIvwGUCq0woWN BjzJDAfv+Gxvbb9AaRcBQDRtVfAHoiwIjO+Gt1DgP3lHhENrnKac5uYjG0PPYJJgXOjR O4H0AQ/y/uXsNey5XrMT56ut0eT50Mmq+DS9V7uEr1GaWmDuuTYCW6D8W5pMFz5x74bl ihMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9hveVbIDpgn6uQm0dQwglwUI+7jtou5mnh2ui5PDEjc=; b=bwk7WLX3C+bDf1maVLbQykxGyxOZ25bBb4TeWCNQND0Yq+TDJYxBTbzRHTmnUunwEl doQWgSCZTj/3JWjys551LZObnHYqbwKWUN0hKN3xgBd3DhIY+vh0WDklrfrR33hEdHE8 Jsjyhe3aWCBTbagV25dBqww4jA42ni2wX1aSM2HDiK5/Qxp78f+TxWc94hMGUUnAisbw 0l0kCMzXv/OYBZylKE9M4xXp1bSybcVZ04N7PiDViuvE68MCDu6fd5NlE+jVrlXVQOzd 8fJ+QH2ozMF2fIGYWi6VL0hIqf50L7YUzAC7QcvNQ3p1g9Uhy9QmfGJtxu9mVs6JaCPT XLqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a170906780100b0073ddab3aa79si8205239ejm.792.2022.09.13.02.38.36; Tue, 13 Sep 2022 02:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231723AbiIMJgz (ORCPT + 99 others); Tue, 13 Sep 2022 05:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231558AbiIMJgi (ORCPT ); Tue, 13 Sep 2022 05:36:38 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBC0C25C6F; Tue, 13 Sep 2022 02:36:36 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MRdYH1PCnzmVPy; Tue, 13 Sep 2022 17:32:51 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 13 Sep 2022 17:36:34 +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.24; Tue, 13 Sep 2022 17:36:33 +0800 From: Liu Shixin To: Thomas Bogendoerfer , John Crispin CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH 3/3] mips: ralink: convert to DEFINE_SHOW_ATTRIBUTE Date: Tue, 13 Sep 2022 18:10:38 +0800 Message-ID: <20220913101038.1902389-4-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913101038.1902389-1-liushixin2@huawei.com> References: <20220913101038.1902389-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin --- arch/mips/ralink/bootrom.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/arch/mips/ralink/bootrom.c b/arch/mips/ralink/bootrom.c index 94ca8379b83c..8c8cc0a81ed8 100644 --- a/arch/mips/ralink/bootrom.c +++ b/arch/mips/ralink/bootrom.c @@ -18,22 +18,11 @@ static int bootrom_show(struct seq_file *s, void *unused) return 0; } - -static int bootrom_open(struct inode *inode, struct file *file) -{ - return single_open(file, bootrom_show, NULL); -} - -static const struct file_operations bootrom_file_ops = { - .open = bootrom_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(bootrom); static int __init bootrom_setup(void) { - debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_file_ops); + debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_fops); return 0; } -- 2.25.1