Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1643453pxk; Fri, 18 Sep 2020 19:53:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCMmCM6pSorg6v7xu+Ws4LhKpq4ASOmGhq+igvNHvH4pX2Gfn9VtQ3AAwdc+s5yeYcXopX X-Received: by 2002:aa7:c7da:: with SMTP id o26mr42701759eds.261.1600483998875; Fri, 18 Sep 2020 19:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600483998; cv=none; d=google.com; s=arc-20160816; b=bnoKDRpU2drY5NO+sXsotZF0Ah3+UAQFen7ggEnbtfSPJfZzZQFbcu1KTyGVVMI5Vu 1fseDhVnMZx6AJ/SE6Qotz7cWtPoAL6YJg8TD/vZ+nRtLm1nriRBdxRqKANCQ+Q9RU5N xJ7yS1lBYa3Uxc5WDzN35igGFjbmFbSnw9sNTzUtZqX6H2kKaNSP/3QMtl5yTIi3GcAQ 3jmIKlvptUDKcBygXxnJQfvbvEugoV8kyVl7RZ6P3a0IPzHsbGti1xj02R1iUsPT21Ds nIpm9zCRvH+NAWeWbN/OD8Gc3aHMgDj4T0uocQGCOyekOSoOxJT8jIUuFZKRp92AM9Rv 6+SA== 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 :message-id:date:subject:cc:to:from; bh=nK6ZeRwC7Gr7w4qHOmlIMPD03e2BdCSDzFRt5mv7BKA=; b=jPHwJPURLoYhLpoDkjHLxJkr7IdTtu5gRph/cbMyrzDy7dmJ1+r05xQoVM+LcQ71tH CQhbGDqwFeKmENfntrZI9+JRrsLUAXSl+QWGWNRU5OiNquxVE1zuxk6k1P4JimQeN2zc I51BLJm+EEtOcJ9UOzk5zQ/PYuHvpPY9ORPEoFRUIUYow+YflCkNyYgmwo5AWBTtIcgB xP4yyDYPlnrFSD3/cQ7xLs/Epgg9IYhjDvaRmKOhufhP8OwwG7XoDn9Iz+2YP2Sl1Ag9 DFna1eGteCM5ngZ1zH+nUTMcit7/Cq780ONARd1Sbe/GAn6K2zDtGCt0kc+rWQ48ZfLX +0Jw== 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 r17si3566743ejz.238.2020.09.18.19.52.55; Fri, 18 Sep 2020 19:53:18 -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 S1726366AbgISCvh (ORCPT + 99 others); Fri, 18 Sep 2020 22:51:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13714 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726219AbgISCve (ORCPT ); Fri, 18 Sep 2020 22:51:34 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id F32DBB5AB0891178E000; Sat, 19 Sep 2020 10:51:32 +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; Sat, 19 Sep 2020 10:51:24 +0800 From: Qinglang Miao To: Mark Salter , Aurelien Jacquiot CC: , , "Qinglang Miao" Subject: [PATCH -next v2] c6x: pll: Convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 19 Sep 2020 10:51:56 +0800 Message-ID: <20200919025156.17142-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 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. arch/c6x/platforms/pll.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/c6x/platforms/pll.c b/arch/c6x/platforms/pll.c index 6fdf20d64..366c9fe6a 100644 --- a/arch/c6x/platforms/pll.c +++ b/arch/c6x/platforms/pll.c @@ -417,22 +417,12 @@ static int c6x_ck_show(struct seq_file *m, void *v) return 0; } -static int c6x_ck_open(struct inode *inode, struct file *file) -{ - return single_open(file, c6x_ck_show, NULL); -} - -static const struct file_operations c6x_ck_operations = { - .open = c6x_ck_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(c6x_ck); static int __init c6x_clk_debugfs_init(void) { debugfs_create_file("c6x_clocks", S_IFREG | S_IRUGO, NULL, NULL, - &c6x_ck_operations); + &c6x_ck_fops); return 0; } -- 2.23.0