Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1643311pxk; Fri, 18 Sep 2020 19:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxghYRDNBuHCU2cAh84MyDnYxxkzJPo45h+u+nmQl968a796JJTE5YMGMn3kqKGFaY/lv04 X-Received: by 2002:a05:6402:1717:: with SMTP id y23mr43667310edu.112.1600483979632; Fri, 18 Sep 2020 19:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600483979; cv=none; d=google.com; s=arc-20160816; b=GLKjy8H/Lq1RqGmLZOR1Q2lnxHmo6xAMWLyGNqC9cmsS2FvBB15a5Vk8lK6BEdRlnW Fpp+nyGQqQVVSLM10Ci74ygRatCXognblv8m7qmkWOUVgyTEtPdm8HNbMacf9GHclwiB 9rgAW5XblR/dY8Zj3kvUJWN1pq+yAax58rl9A9ZucOZb06rOncJ0Opg96wj07fSJKeNY UCQKQpF1vdNa6lkcSokFMvYLtZS/iU3pqw3jLPsFdyWfZCvCDsRlAf+49lloZulE7S3B +NQPnjsqLHijnVgRdseA3FzWSk/iI13vhy5V76JB0KFILzDP6OI+sH78+gQuszzxdG5Q BJ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=74ikFEiuTf0so3gbT/ocsbmzgL9s8O0P2rw19kLzvn8=; b=j7ws0w4xUUL9Uc5gRq7KRJ63u9He2u2i+/aKLmSHtuex8BJ7Eb1SJC+iW4xq4nZHBs UyPQjrWRQMzI/6BuIvaL5qO3rTWCffVQXJ+BAyirMjO1ApGtSymsIifKfnFXgdIOy/04 UhwSp4L9ygHZqBh0tUF3J4vz4yx8WvitdUmiX2Io1tRAvqlbgS/fL4R4lk8HO8zu3aQA A9zZiGRdnrzSnPA5qETvynUU9kszgZONSkld6DddyqQSJaNXK2PWQqy7XemuFkK33QC9 3jcTsOLlr0SMSi9P+c5R8RmibQjJy+L723x/L2XeZ5KHbb8gRXGRyPGriHY+5cYADLf+ 8mfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i21si3436097edv.439.2020.09.18.19.52.36; Fri, 18 Sep 2020 19:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726338AbgISCve (ORCPT + 99 others); Fri, 18 Sep 2020 22:51:34 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:51242 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726009AbgISCvd (ORCPT ); Fri, 18 Sep 2020 22:51:33 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8BE50A26CAD265533467 for ; Sat, 19 Sep 2020 10:51:32 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Sat, 19 Sep 2020 10:51:23 +0800 From: Qinglang Miao CC: , Qinglang Miao Subject: [PATCH -next v2] bus: mvebu-mbus: Convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 19 Sep 2020 10:51:55 +0800 Message-ID: <20200919025155.16973-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/bus/mvebu-mbus.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 2519ceede..4439612b3 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -470,17 +470,7 @@ static int mvebu_sdram_debug_show(struct seq_file *seq, void *v) return mbus->soc->show_cpu_target(mbus, seq, v); } -static int mvebu_sdram_debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, mvebu_sdram_debug_show, inode->i_private); -} - -static const struct file_operations mvebu_sdram_debug_fops = { - .open = mvebu_sdram_debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(mvebu_sdram_debug); static int mvebu_devs_debug_show(struct seq_file *seq, void *v) { @@ -520,17 +510,7 @@ static int mvebu_devs_debug_show(struct seq_file *seq, void *v) return 0; } -static int mvebu_devs_debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, mvebu_devs_debug_show, inode->i_private); -} - -static const struct file_operations mvebu_devs_debug_fops = { - .open = mvebu_devs_debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(mvebu_devs_debug); /* * SoC-specific functions and definitions -- 2.23.0