From patchwork Wed Nov 7 16:13:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10672621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5DDB109C for ; Wed, 7 Nov 2018 16:14:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3C652C227 for ; Wed, 7 Nov 2018 16:14:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A79752C81E; Wed, 7 Nov 2018 16:14:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 60F4D2C227 for ; Wed, 7 Nov 2018 16:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=CKNpkoWga0Z+Wkz7eCj2FSLJT1lhd4o7Ivz84fWDtJE=; b=ObK ChAHUu7bYY907T37R8KuIVMvBGjcrkYBqE7jFIY1JmhXON5OYXPokHBndZJ1lfqp+VOOh9EgRAdE3 ZoUJRK/HeggHjlCfg+UyT5FTAWf1TnzvcG58IcxTwPFJZoyeha0BnGfLehqOVoXWVrTqNFpxhQ2pv rliqTVl41OetM5XFphMVIIgSQKjrgskKSvWhsW39inLOlsgn1bsZQb8toMYLvw/sM0S47KTQFziLj s0+/miaIoB9cUODfgVH/QBIEmmjtXv/j+BIE68lmGKrBzUOql0GJIupTCSrMpbEZgnFaOMdHbtVMY Lh7dwchVvDEutq7QYJ/Ii+XN5302R0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKQT2-0000Cg-Kj; Wed, 07 Nov 2018 16:14:08 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKQSv-0000Br-Vp for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 16:14:07 +0000 Received: by mail-pl1-x643.google.com with SMTP id w24-v6so8071201plq.3 for ; Wed, 07 Nov 2018 08:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Lox9KQgZnOoEyjfEFNSeuDDi1nxxX0S1XCxKVJQw29s=; b=mu++ttjRXA4YWXwtlwfHfB0LX7lkVZUY39HZvN3ojHtMm2mBh+YwvDdJVgvAqJDbut yH/z68Qa7uNGgn8doQegnsdetIbb2PXWo/9yBT46pmsSKE4FQGHUORp5RuEnTT+h80B2 zENtYfJGbPjedXCl50Hfc7imchMGM4wHfbai6fva+yDL+RFkoFLoXs0z813A/8gDhToP Ga5a0claT0l7PXHL6OnzZii+BzcbpM9aoMrMiLVUF87Ym+HB2Ia917vNqkmlMkF29zB1 Ysc3+OrjjtLoRi46blWhjg2UjXiQY+ioyK1lbgFyrCOTlXyh3e7dlJJ/SveM+Q80QINH TDZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Lox9KQgZnOoEyjfEFNSeuDDi1nxxX0S1XCxKVJQw29s=; b=aN64pm4B+XP8ayyr290vSRBkigmaRuXcuULlAQ0eVrlaKRr4hRLcvU6af4KAu4RdIL 42xvOpa2iTadJY6nFew9tDnkKiUsChprNldu8lKw0RofKEikUfCFEDsMMKzzV88nX+HR uDltnX3zE5E1DLaGc/OJxSSLsNhh6FLaH2ZvqVCKkN3FzYXdOVBatE1mhDNNNXmwLB21 Qx4u3AAb0JkccvssDuZk7FP4Yqcsq3Nqdtmqkwvp3p5EhEs3+UQfpsMwakSAkWAA0BKt jTSvCMqJGLA3e6BWmi4cy1VGRS5UQ7fy+kzBAAG96wRjPfuCSO8SoirKtqvFenJRM/fZ /lAg== X-Gm-Message-State: AGRZ1gLZfzNi8wZ2bNwWn+Xj9z52IpiBsOqjHMV0X0WKwC7Gyz6Kdz6W mU6Ioyo/J3wq/miW32GCVbc= X-Google-Smtp-Source: AJdET5fQeIIx6qmrT+1NijLeNbfF37kw85pnsdvVJKISOZTqy6aui6JsTKs503q5sTDQXL2VDfd9iA== X-Received: by 2002:a17:902:8210:: with SMTP id x16-v6mr835162pln.129.1541607231093; Wed, 07 Nov 2018 08:13:51 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id w10-v6sm1199407pfg.1.2018.11.07.08.13.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Nov 2018 08:13:50 -0800 (PST) From: Yangtao Li To: kgene@kernel.org, krzk@kernel.org, rjw@rjwysocki.net, viresh.kumar@linaro.org Subject: [PATCH] cpufreq: s3c24xx: Change to use DEFINE_SHOW_ATTRIBUTE macro Date: Wed, 7 Nov 2018 11:13:46 -0500 Message-Id: <20181107161346.9887-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_081402_018763_8AC76E52 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yangtao Li , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Acked-by: Viresh Kumar --- drivers/cpufreq/s3c24xx-cpufreq-debugfs.c | 46 +++-------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c b/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c index 4d976e8dbb2f..0df87b6480fe 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c +++ b/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c @@ -63,18 +63,7 @@ static int board_show(struct seq_file *seq, void *p) return 0; } -static int fops_board_open(struct inode *inode, struct file *file) -{ - return single_open(file, board_show, NULL); -} - -static const struct file_operations fops_board = { - .open = fops_board_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; +DEFINE_SHOW_ATTRIBUTE(board); static int info_show(struct seq_file *seq, void *p) { @@ -105,18 +94,7 @@ static int info_show(struct seq_file *seq, void *p) return 0; } -static int fops_info_open(struct inode *inode, struct file *file) -{ - return single_open(file, info_show, NULL); -} - -static const struct file_operations fops_info = { - .open = fops_info_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; +DEFINE_SHOW_ATTRIBUTE(info); static int io_show(struct seq_file *seq, void *p) { @@ -162,19 +140,7 @@ static int io_show(struct seq_file *seq, void *p) return 0; } -static int fops_io_open(struct inode *inode, struct file *file) -{ - return single_open(file, io_show, NULL); -} - -static const struct file_operations fops_io = { - .open = fops_io_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; - +DEFINE_SHOW_ATTRIBUTE(io); static int __init s3c_freq_debugfs_init(void) { @@ -185,13 +151,13 @@ static int __init s3c_freq_debugfs_init(void) } dbgfs_file_io = debugfs_create_file("io-timing", S_IRUGO, dbgfs_root, - NULL, &fops_io); + NULL, &io_fops); dbgfs_file_info = debugfs_create_file("info", S_IRUGO, dbgfs_root, - NULL, &fops_info); + NULL, &info_fops); dbgfs_file_board = debugfs_create_file("board", S_IRUGO, dbgfs_root, - NULL, &fops_board); + NULL, &board_fops); return 0; }