From patchwork Thu Nov 22 12:48:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10694125 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 BCEB913BB for ; Thu, 22 Nov 2018 12:49:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB73F28F92 for ; Thu, 22 Nov 2018 12:49:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EBF12B873; Thu, 22 Nov 2018 12:49:21 +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=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 4F70728F92 for ; Thu, 22 Nov 2018 12:49:21 +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=GfExvV8rY+rqSogQRamTenmru6yWQ4Mo+NgPLxfKG20=; b=TKB fq+iXfb24PjusSuQ/ETvybRmrF4qcX4cNM8a8t3C7wyMsMJRw249lLV7Ei8gExHs6kyZHCmXp5GBS BTPFdD1UbrZnSpzWYy4UjtYRYDjp0z5AXCEcwsQI3qeaglS2HIgnMsKatJpF1F1NC5/M7rW39Rpdp 0R1NBZ2x6a8ib9Uui0kpMLo0TD2gmZfmRCkDPIVVILAP6+krpO6GTfrC4Lke9RF1PRtLy99gCN7dh bybky+kx0rEzH75+z1bhUJ1lZDkWhTfNufr+EzD6VYNBJF6WNf9bXKmOGrQDWJsZ2J874RdCfs2Gg K8zM2Xoifq31KoPNXf2vpSryWtLONww==; 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 1gPoPy-0005Qv-OA; Thu, 22 Nov 2018 12:49:14 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPoPv-0005Pr-4e for linux-arm-kernel@lists.infradead.org; Thu, 22 Nov 2018 12:49:12 +0000 Received: by mail-pf1-x442.google.com with SMTP id i12so1919276pfo.7 for ; Thu, 22 Nov 2018 04:48:59 -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=pbT7cvBR8SJ68SpnxSZaalCbxAC+rUz74D+MN8UMqMA=; b=XMYGk9lZTEPIVgUaW6Z0d3dBcsq8hNJAloTXxKlkXxMBVUBWspYVHKkWfHdJ/1RH7u g2nZcC+Ja9Ek8ByJtOXUTUwdP4CQjSEhjb6t7A/xX6hV2sPocVFsL6Lv16c9vv9GLgTY 0oxxsyt7SJsGTyAe5KJwovQoh9Bz8Q8W8DWmJwqqiD8YRT8Kxd+tQ7Z3PaMOHfMFAcuz gJZuh/qdnYAMMI9SLrsz7dYIaGjdy61lEGrS3y42MfncPmq1z8yc/M++RsAN4400C7Ja 6m+S3by3Mr4tuDBleRX5k8YS5Mai21E7guulg9rPHxt4czuQFlFOTMh7QXz7czWVo6js B+dQ== 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=pbT7cvBR8SJ68SpnxSZaalCbxAC+rUz74D+MN8UMqMA=; b=RaB+YsJHXtBdbWNfUtyEacjZFWTrzGW9zZRo4lmbNtRpL7c1+h5EOOhMZ1TQ0AC+5L f3XomPR0m8FOcpWwkrHuyBnQohQw1MvJ484WQvvn2BV+dZKOxIde5AhSWADXLloaEkew OIcqQHTDKIDYhdVq17OAvvBRPDjH74TAlTtUHlWcRApIl0Q9l8n+8wqVXOJJ4/w1QgMt KspSAxnDoJ8uewDFWjN7nlZCAwRMRssExM6zwKETKcn7vFtb+BcWJvw2irbWyAypzt4z Z0kymQQVjEnXIOSJu5trVCjkUOubE05KkbKU9kkUEjPP1KNSeBKPtZ6pvRerLvBDb03g UlXw== X-Gm-Message-State: AGRZ1gLWxR3qu5dDaQxir7gCH4E2jyy8qfO7TTUXQvXzN4zzNYdNZ2NY kSBiSfTl0lfFaBE1FlxceSGyxZGhr+o= X-Google-Smtp-Source: AJdET5ftjKAdPlS/MeYhnLTAKTv6NdyLZZj7De9BBKmsKOdH3RE624+0qabhSKRDXs+71Diu22HEmw== X-Received: by 2002:a62:da5a:: with SMTP id w26mr11310546pfl.106.1542890939126; Thu, 22 Nov 2018 04:48:59 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id s62-v6sm62456526pfb.73.2018.11.22.04.48.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 04:48:58 -0800 (PST) From: Yangtao Li To: ssantosh@kernel.org Subject: [PATCH] soc: ti: QMSS: Change to use DEFINE_SHOW_ATTRIBUTE macro Date: Thu, 22 Nov 2018 07:48:54 -0500 Message-Id: <20181122124854.24528-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-20181122_044911_181963_2893ABDD X-CRM114-Status: GOOD ( 11.15 ) 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-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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 --- drivers/soc/ti/knav_qmss_queue.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 8b418379272d..67f7c003417b 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -483,17 +483,7 @@ static int knav_queue_debug_show(struct seq_file *s, void *v) return 0; } -static int knav_queue_debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, knav_queue_debug_show, NULL); -} - -static const struct file_operations knav_queue_debug_ops = { - .open = knav_queue_debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(knav_queue_debug); static inline int knav_queue_pdsp_wait(u32 * __iomem addr, unsigned timeout, u32 flags) @@ -1883,7 +1873,7 @@ static int knav_queue_probe(struct platform_device *pdev) } debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL, - &knav_queue_debug_ops); + &knav_queue_debug_fops); device_ready = true; return 0;