Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1060396ybh; Thu, 16 Jul 2020 01:56:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyawJGT18iwRtoC5V8TiFr+/Jj9sRuk9VDtVuk3CmZ9810/+/+1DYysymas87ANSb3ICvsX X-Received: by 2002:a17:907:1051:: with SMTP id oy17mr2857347ejb.394.1594889773512; Thu, 16 Jul 2020 01:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594889773; cv=none; d=google.com; s=arc-20160816; b=TV0tr+UB5WGfQuLaaur1W8H6gJztNAMqbW4NDyLtiJ4Z/YJDKJegEP3m+hQN+KVPL7 LWFeN4XRr6KvJHS1My9hPV1mGXQVd5X67UvnaMIjr96v7F6yKRc+mXJA0h1HvkFEJefX ab1ANtvQ8X/jqxBfhh4T+M9MpZK2JdgtRNXEB8+sUP7J2mZKR9jTOfruFTVt+m1b/a5i nIAExbmWgFn2lyxA7AQucLNnhTq2s4+ncr5b8JE6fPQfupHVqsmdiEagVjUogOT+lUxs iZ6Hm7VaByPL0HeYg7lpNXWPqfsF5iYEV9DdfSfh7Tto1oQ1Yv2CcLHucu3NUiBdm5sP fy8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rjL5gfDG55AsFuj7JqbuZmQ+tYkJi3EAL3J7g6F0h6Y=; b=dI8cC0Vl4TbYVz93e7WEPdVU4560YYYm6lwJlGzmPWcrcnhee7PMImFNeL6/01WHq2 OZfxbeGsmCc2FnsRHPjLNrtIH9NZY/FyR/PPZEnnY9F8lYTTpr1qIc0+/c4HRXtl2ViZ LQjatIaw0ek5rDDngoUyoqAHTX+wYJd7hAdSxHRffHVZt8hvA76fHXYSaLBkgx4zukRl qSDejmemNiFZn4Yfhc8+I2Lz+m9I951VkzlOrommwRNzbcdsmdm5S7WqoV1ngbRDwaIl K40Xvx4iFLWBGEpLAhlG4AzM2nIqaUBwrM5tyD4ymr8Wg+x47+6d5VFAHRo2u2UGr2E1 nFJw== 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 m26si3599751ejn.625.2020.07.16.01.55.51; Thu, 16 Jul 2020 01:56:13 -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 S1726782AbgGPIy5 (ORCPT + 99 others); Thu, 16 Jul 2020 04:54:57 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7760 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726013AbgGPIy4 (ORCPT ); Thu, 16 Jul 2020 04:54:56 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id ACAD59071DE4AB4BA700; Thu, 16 Jul 2020 16:54:54 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Thu, 16 Jul 2020 16:54:53 +0800 From: Qinglang Miao To: Greg Kroah-Hartman , Sebastian Reichel CC: , Subject: [PATCH -next] power: Convert to DEFINE_SHOW_ATTRIBUTE Date: Thu, 16 Jul 2020 16:58:49 +0800 Message-ID: <20200716085849.11571-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yongqiang Liu Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yongqiang Liu --- drivers/power/supply/da9030_battery.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c index 292ecf875..0deba48d2 100644 --- a/drivers/power/supply/da9030_battery.c +++ b/drivers/power/supply/da9030_battery.c @@ -172,17 +172,7 @@ static int bat_debug_show(struct seq_file *s, void *data) return 0; } -static int debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, bat_debug_show, inode->i_private); -} - -static const struct file_operations bat_debug_fops = { - .open = debug_open, - .read_iter = seq_read_iter, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(bat_debug); static struct dentry *da9030_bat_create_debugfs(struct da9030_charger *charger) { -- 2.17.1