From patchwork Fri Nov 23 15:06:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10696045 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 8D13616B1 for ; Fri, 23 Nov 2018 15:06:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C8B82B638 for ; Fri, 23 Nov 2018 15:06:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FE8E2C411; Fri, 23 Nov 2018 15:06:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 1A4052B638 for ; Fri, 23 Nov 2018 15:06:18 +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=PX5mXuETPxH6UwSRvUJ7dMMvJfLRfPq8sVULaJfB+us=; b=oJy DDusyFQFeLcG/ajJHCe3uoR9C0tWM1PzbOmaaOHazemmJ+Bqf8PqVcxqflBYqCqZlH58oljObgrxG u8uZ2Hurcrm15FmO8T53lb8VU+MxRXVtc01TekwgZh0J8K5i0D7OUIs7wwoM/hdUIhm+NiNkeVqGV h1w4eSyJjJYJKkWq+vwMf6KtwDTdSgI0sa7/IYsVA15hyAmuGyAkXUP2y6r2DYUYsc/ouRvv9y1xv C+hs+coC6lCBkO+5X2wpAmXpOrOcLlm/72AdurHrQABZDgBu3B/XYIjsI17CyoPmFdIrxhvsAUWUp F4Wf22GR3WdLwGUnBVE9KBVC8zdzapw==; 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 1gQD29-0002ri-CP; Fri, 23 Nov 2018 15:06:17 +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 1gQD26-0002qB-3b for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2018 15:06:15 +0000 Received: by mail-pl1-x643.google.com with SMTP id p8so481763plo.2 for ; Fri, 23 Nov 2018 07:06:03 -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=o93J3BNmQ1ja0KQUj6SiJX6FygDGjFCA6M1dZJot1uE=; b=mFRwRuCPqjoymA4JuaqepvwJHuV1PDSoKmqcgFOKuswVOTcfSBWBaKCSUCnEt5YBtX fwEMM/EVakz5gk4LrX2s8c1ysRJa8qF2cjK4LDRGYHLYPwzuVGZDJ5Y4wEi+kiTiz4EA q3Lz0uMYioJCVy0phEuJvICLf3r3Q4c8R1fVICYcNbH/0XU3xAVk8owuuef608PDr82m mMxDRLbMc5nP5yv6jNw5UX/jGdfDDu6EuCyvdqNSwxGikV4XfPSOT3dfNyIwXl7GiTzm oAX4ZXyU5cGJSVa87Nb6YT8TXxNocp29ySApVipt59dZSAK7oLfSmJ7as5ri6tRLr68X Vlfw== 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=o93J3BNmQ1ja0KQUj6SiJX6FygDGjFCA6M1dZJot1uE=; b=Yjsa+pmLQVIYzLXqkpTimpQfHMJwQbV1t3KUBwUb7ocIBG5Z3N1abcdkaipmFwjOMD sbjzSna11huRvNghOpvOstAgtkW6iOIcVlVWlLEKsm0Z6dT3trmaarKSk9jGhAgqq6ki TAjRTO2k4GBisT1MN9MN+d4UkUNrWZniZLIMFM9EOAC6SSG7s+8NhMWHJJEE6cEp+oUB wB1MuMiY/H0RNs9ZQrvPWNiWR9q5LHbCR1OUCjc/7jAbiApwSvlivxkzoop4JPL7Fcgp u4H5crNSHLr7Te1fjP8LFDaNaaiHTch1hPhLDgtLmGn3bwS94yKF1VtioY7huUdt+NvO 2GKA== X-Gm-Message-State: AA+aEWYkHZryhgB9SMlwu4HQnGbCH8xbQnN0zrcHIV2ufHJ8wsPYhzCA ZT/UcPkT1caMZlk5XJzwJwk= X-Google-Smtp-Source: AFSGD/UTuZcoUTgvcKZD8g8ZJhdVgVKkGwCPqTfRkk2QrIYj6gUJ0dlZymb2tUE69mD85Dnk1vdRsw== X-Received: by 2002:a17:902:12b:: with SMTP id 40mr1893146plb.72.1542985563210; Fri, 23 Nov 2018 07:06:03 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id u127-v6sm62690898pfb.47.2018.11.23.07.06.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Nov 2018 07:06:02 -0800 (PST) From: Yangtao Li To: linus.walleij@linaro.org, mturquette@baylibre.com, sboyd@kernel.org Subject: [PATCH] clk: nomadik: Change to use DEFINE_SHOW_ATTRIBUTE macro Date: Fri, 23 Nov 2018 10:06:00 -0500 Message-Id: <20181123150600.27445-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-20181123_070614_149543_82B261BD X-CRM114-Status: GOOD ( 11.55 ) 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-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@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 macro to simplify the code. Signed-off-by: Yangtao Li --- drivers/clk/clk-nomadik.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index 84a24875c629..e331634d34df 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -479,17 +479,7 @@ static int nomadik_src_clk_show(struct seq_file *s, void *what) return 0; } -static int nomadik_src_clk_open(struct inode *inode, struct file *file) -{ - return single_open(file, nomadik_src_clk_show, NULL); -} - -static const struct file_operations nomadik_src_clk_debugfs_ops = { - .open = nomadik_src_clk_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(nomadik_src_clk_debugfs); static int __init nomadik_src_clk_init_debugfs(void) { @@ -499,7 +489,7 @@ static int __init nomadik_src_clk_init_debugfs(void) src_pcksr0_boot = readl(src_base + SRC_PCKSR0); src_pcksr1_boot = readl(src_base + SRC_PCKSR1); debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO, - NULL, NULL, &nomadik_src_clk_debugfs_ops); + NULL, NULL, &nomadik_src_clk_debugfs_fops); return 0; } device_initcall(nomadik_src_clk_init_debugfs);