Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp35299pxk; Tue, 15 Sep 2020 19:30:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPLQOtZCIwF0vP+58Jy4rmlhONtI735YohgxMUg/IPCo7B0CmI7bVTQ84w7DskqJasNEYQ X-Received: by 2002:a17:906:eb4d:: with SMTP id mc13mr23158977ejb.234.1600223426786; Tue, 15 Sep 2020 19:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600223426; cv=none; d=google.com; s=arc-20160816; b=n7TXyzM7ooZbXh0Wyyi0XYJXk5EaS3VEU78WEAwOuJbc/TKUxjtKBbiPgb6kw7mzB8 oO1n7XqkQlvLD+W2S2HSirxR/NtoaP2EFTlXu3go6+1LUkFnXFE3vHnNkczc5QvN0mSd dSOI9ltzdHE+4u0YT5s0TyizZaWWSM+KqWS51emr9OUlJzR+irp5lIxy4QtzOpo9jt8S wTdkqtTzaLlRJzh32Uq2LbOTe2PhuWR42pLNcFwVPU8FPtwRWwdujrz2GspQ9CWb8FJR jMVX5GuO6gmMmp8nzHyTjWv9EsMIcF7PGh40sGSsVIhccl8KloD+6EitUI7h2wvlB7Cc xTiw== 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=NNI4v0ac1SPHj9lhAQmimE20zg0wI/Y8dF2Tb57JS7o=; b=hyCMrq5qFIGe2dLjagbyfK9ppdvzxwrDvI5nxblLH2/3SSjtuFgZ9e3zGsrTjR2731 GC0e4tXLscRZDHQzh1v0/Hjrx6gmhs/wqY14FLJ/nDoEK6BZeXSjl47w1i6tUcuAhsgX ja5P3sWjyBKmug/B5gAxkQk9bjj0If9gINFR/ATzWYJ6JGBtyVJdf1z0DoWG2XWcXLUe kVsbQqrCM/foDAiQcu/AJ9aBesmyUZqkkfWiqV0S7MBk2F0iGdS7WJo014D7Jdg1B6VP EsC72SVWExgZCQeE1vvt9D9niMI6Lv+p/5f28okLYBnrAD59BEHznreaBaWFalmN5np+ qXtQ== 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 gv22si10811384ejb.536.2020.09.15.19.30.04; Tue, 15 Sep 2020 19:30:26 -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 S1726489AbgIPC2s (ORCPT + 99 others); Tue, 15 Sep 2020 22:28:48 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12296 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726405AbgIPC2C (ORCPT ); Tue, 15 Sep 2020 22:28:02 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3B3D2119396917439775; Wed, 16 Sep 2020 10:27:59 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 16 Sep 2020 10:27:52 +0800 From: Liu Shixin To: Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , "Lee Jones" CC: , , Liu Shixin Subject: [PATCH -next] pwm: convert to use DEFINE_SEQ_ATTRIBUTE macro Date: Wed, 16 Sep 2020 10:50:28 +0800 Message-ID: <20200916025028.3992887-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin --- drivers/pwm/core.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 276e939a5684..1f16f5365d3c 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -1327,30 +1327,19 @@ static int pwm_seq_show(struct seq_file *s, void *v) return 0; } -static const struct seq_operations pwm_seq_ops = { +static const struct seq_operations pwm_debugfs_sops = { .start = pwm_seq_start, .next = pwm_seq_next, .stop = pwm_seq_stop, .show = pwm_seq_show, }; -static int pwm_seq_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &pwm_seq_ops); -} - -static const struct file_operations pwm_debugfs_ops = { - .owner = THIS_MODULE, - .open = pwm_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; +DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); static int __init pwm_debugfs_init(void) { debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL, - &pwm_debugfs_ops); + &pwm_debugfs_fops); return 0; } -- 2.25.1