From patchwork Wed Dec 5 16:18:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10714513 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 DAD6617DB for ; Wed, 5 Dec 2018 16:19:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA1BD2B470 for ; Wed, 5 Dec 2018 16:19:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6FEA2DB8A; Wed, 5 Dec 2018 16:19:26 +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 5D9EF2B470 for ; Wed, 5 Dec 2018 16:19:26 +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=Bpxgp+e63wHXDrsHBAsjtnz//7pd0G6UNQr5nt2C6FU=; b=LRM h5Tu9gBrsQx4Rh/u3K82HXE17sVrqoGcgdFUfcWLJP4Hd2lzqoVM53kSH/zjHDoi0UAlMxaV+4Uka 76jh7Qc52x7XcLironW9iBJFIVWTFaZCYeAD6Ncto3yatH+VJeaksFuh0OxZddKFtgIUG5i5nnGd3 XyIVcHPmjLbfLkFf6VhzbowVCnrdQpj0esQwaC1jz1YxcwvDLFlxLpRwgWdB8MlMFyNU/0fl1jjrY Vi6+WZ7xje3dHW6QwuN4W8ejAIJ4OExcnftSXSt5YBfPqCdkClnRFJoPg5SSJuLD6nvNKKWPkMe3o Xz5Jx2rCMjV6DMs+OoqTUKlGhX97yCw==; 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 1gUZtQ-0004Xh-6g; Wed, 05 Dec 2018 16:19:20 +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 1gUZtN-0004WV-II for linux-arm-kernel@lists.infradead.org; Wed, 05 Dec 2018 16:19:18 +0000 Received: by mail-pl1-x643.google.com with SMTP id 101so10289662pld.6 for ; Wed, 05 Dec 2018 08:19:07 -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=TkmL002NIrFI/+qlHIQs+8PHenuR75IqlFLC7k33xLk=; b=h4Tb8vA4breO2EQ5nRHAlajpKtVZwS4M19enDNuL/h72S0J0Xk8HY+FqCYMti8Bi3d 57gkNY9J8ZDog3o3O3Q+w0Qfk4A7ntOY0yUU84ywqtRyEGVkoXmG7/9JqaA5UOOVPK/V 1smgF1Z2gJCvYtJ4zW5ZOnf0GHXEK/KqfU1F/cD//mlV/q4lqC9sumKSyoXTZwZ68ba2 +PA7u1AAAhbdIOxvN4d+Wvixr/uPN5Ck4i2MbOJqouFObt1SKVytSbp3AGlpd1Y0+2kI 9PB58N8BMjqanRlJdziFthD5U4HKPZS8j91HB5e8SRsOoeF4hm3U+p8Wq3THXzve2SYM 92YA== 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=TkmL002NIrFI/+qlHIQs+8PHenuR75IqlFLC7k33xLk=; b=gEjs2Sn6xYtiP/c5Lxf/Lq93xufOIfBebIW9vLr8EF25jBckj5yWHgLDKTqxDHyMNl 2UPfUXWL/hOjYBwe2fVw+Ikb2tSF/qrYvdCcwMkJ2tMhA5rg4Al2+mvAK3Ac2Dk5xr93 aGKEZtKY2trSJZiLhSws/zGFOV5P8y+HIruFxbGjEQu5OeUGpfE0hbISgGDlymm8N1hl oX6tpxztAlv6h0vKi7P3TcIdvFC0MhVgpnButtxkugEI2KMKlP/XMghhy1j2r/pgQPxm IXTK+9a3wsmPfArm6oIdh5jrRR+yuYy1xGMVG82mIaHkFUCjfLNR5HNwRGtqGEPkG3Gk F83A== X-Gm-Message-State: AA+aEWYBFSELLc47d621kGjC9SQSarmW5jagtwSCYo05f3XRdYYCrbta 9Aiwl2RzIX0Jd7x3S7navy0= X-Google-Smtp-Source: AFSGD/VVDjWyxipNkFrCccRko39MIoR6sZ9UlhG9MGv7loJC8nVBAFn1I0Q6bVwS3isDcnw3CW2L7A== X-Received: by 2002:a17:902:6bc7:: with SMTP id m7mr25362376plt.106.1544026746670; Wed, 05 Dec 2018 08:19:06 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id x3sm66303001pgt.45.2018.12.05.08.19.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 08:19:06 -0800 (PST) From: Yangtao Li To: vkoul@kernel.org, dan.j.williams@intel.com, sudeep.dutt@intel.com, ashutosh.dixit@intel.com, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, okaya@kernel.org, andy.gross@linaro.org, david.brown@linaro.org Subject: [PATCH 1/4] dmaengine: amba-pl08x: convert to DEFINE_SHOW_ATTRIBUTE Date: Wed, 5 Dec 2018 11:18:57 -0500 Message-Id: <20181205161900.16434-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-20181205_081917_601628_FA780C46 X-CRM114-Status: GOOD ( 10.85 ) 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: dmaengine@vger.kernel.org, linux-arm-msm@vger.kernel.org, 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/dma/amba-pl08x.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 97483df1f82e..fc8c2bab563c 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -2505,24 +2505,14 @@ static int pl08x_debugfs_show(struct seq_file *s, void *data) return 0; } -static int pl08x_debugfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, pl08x_debugfs_show, inode->i_private); -} - -static const struct file_operations pl08x_debugfs_operations = { - .open = pl08x_debugfs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(pl08x_debugfs); static void init_pl08x_debugfs(struct pl08x_driver_data *pl08x) { /* Expose a simple debugfs interface to view all clocks */ (void) debugfs_create_file(dev_name(&pl08x->adev->dev), S_IFREG | S_IRUGO, NULL, pl08x, - &pl08x_debugfs_operations); + &pl08x_debugfs_fops); } #else From patchwork Wed Dec 5 16:18:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10714521 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 71D6414E2 for ; Wed, 5 Dec 2018 16:19:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F0FF29B3B for ; Wed, 5 Dec 2018 16:19:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BCD82CC9A; Wed, 5 Dec 2018 16:19:35 +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 EA1082DBE9 for ; Wed, 5 Dec 2018 16:19:33 +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:References: In-Reply-To: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:List-Owner; bh=drWfatc6+vDVc1zikfdtj5q3lIzw39u6Zc+tXMHldAQ=; b=TXES7qrfwhWMQY/esywK18w/EK RrTdfTNAgaBVIhh/vcDVdibtUJEJmlI1ZsaUvGhJNUm+1VczJKEchjSGCnOcemiBjt5fJ3Yy0CO5u a9sRSgk5pi03eZ4EUBr3ezSI2JUoGmhRkTlAlomGvvlNHV3clIrwSCuGRRHr5NWW9wTkOEBivxMz/ 2oAepJYdRzedfXVjfh9Z4+KnGKP01CAJzzk0bsQ/V+ExZkH+wibnAOfVCVGoz8kgo9EpWahSwUo4W +dUqpoWxKUVXqaPud6IRhtT0fneWGbmR7xAyzjKwgzqid0lAaF1WrkAjMrlg5y/Kc5z1Jfgj71Xrr pv50uqFA==; 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 1gUZta-0004hQ-39; Wed, 05 Dec 2018 16:19:30 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUZtQ-0004Wb-PJ for linux-arm-kernel@lists.infradead.org; Wed, 05 Dec 2018 16:19:23 +0000 Received: by mail-pg1-x543.google.com with SMTP id z11so9249433pgu.0 for ; Wed, 05 Dec 2018 08:19:10 -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:in-reply-to:references; bh=UlVfIMfHrGtBTlZv/XK8koRNqWY+54IiT4Z9OFB2kBw=; b=p9zyVDnLTDccX6BjnfxuHmufgkGARQAWH6PNjDcQaP0d7RHLNfobAzQenhVX0TLyQJ DaPB/5OD5dd4IBHTHRb4J4mkeXn7DdZ/tEIkCP/TL2sUPW5NFoIKd9GMaaJSeIlsF32r Vfgh44k3f2+aOQD/A6SsnQQYwRFtvsFQjMkZ32HrGrq1lHXokB7+7mxpAm/YbAYW9Lwu YJc/kQJeYb8hZF5b0ikCCmCKy5MK08ecgte1WLilvRY7anHDTgWMY94YR0Zjf62Tsa8g 4FP5T6QISdsUqOHkEVwFs/GVeCEHg0U4n0zAOoWbfbpUFfd5DApJ8fvNBtCwRb+kVlbH BNfg== 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:in-reply-to :references; bh=UlVfIMfHrGtBTlZv/XK8koRNqWY+54IiT4Z9OFB2kBw=; b=I+hzwG40Gsz+FnzSvhmHJiqNh/yJ3cV/XwkOERv9zIHJmmGuFEC3aHd15dMPt1r2K6 yCzgyA7+XYasFlaWk7a2oVbPPgrtSGsi7vXu8r2eeQIWtk3JSY44/xE0hmMKa903WqQS H6DwhCy82O/mhkCzmdW829gGdyGcvv8uxWT0XjT3mzeziWTyCfkI4U2V4XA/I7ZIrrio ZTBTOoLUdRuofTW4jiMzQR+Lk6bXiRJApE6pWsNQAsUgtqQ6j9PRNwcSQfdJVvNkFZOp osVd/YM65l0vSNcOhtZcTxMq9bxhgUMWy5hS1SdnevakGNFVMmtlmX9428I7waHKxdjX q1Cw== X-Gm-Message-State: AA+aEWbZ0d6yob9IzYY6rtdSwkpljrVQmzdFBbp05F7YcgEwcV2qH3sx dx0yVNlO7MBqjavIHuzt/WI= X-Google-Smtp-Source: AFSGD/WzdxHmUE3nEUbxh/wpldUjRDSE4NVo39PlUajdmLspkBIg9fg85B0OrPZUxw+Y1Xob+V9PCA== X-Received: by 2002:a65:41c2:: with SMTP id b2mr20775172pgq.67.1544026750169; Wed, 05 Dec 2018 08:19:10 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id g65sm104654652pfa.63.2018.12.05.08.19.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 08:19:09 -0800 (PST) From: Yangtao Li To: vkoul@kernel.org, dan.j.williams@intel.com, sudeep.dutt@intel.com, ashutosh.dixit@intel.com, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, okaya@kernel.org, andy.gross@linaro.org, david.brown@linaro.org Subject: [PATCH 2/4] dmaengine: mic_x100_dma: convert to DEFINE_SHOW_ATTRIBUTE Date: Wed, 5 Dec 2018 11:18:58 -0500 Message-Id: <20181205161900.16434-2-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20181205161900.16434-1-tiny.windzz@gmail.com> References: <20181205161900.16434-1-tiny.windzz@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181205_081921_168770_20446D7E X-CRM114-Status: GOOD ( 12.19 ) 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: dmaengine@vger.kernel.org, linux-arm-msm@vger.kernel.org, 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/dma/mic_x100_dma.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/dma/mic_x100_dma.c b/drivers/dma/mic_x100_dma.c index adfd316db1a8..6a91e28d537d 100644 --- a/drivers/dma/mic_x100_dma.c +++ b/drivers/dma/mic_x100_dma.c @@ -676,7 +676,7 @@ static void mic_dma_dev_unreg(struct mic_dma_device *mic_dma_dev) } /* DEBUGFS CODE */ -static int mic_dma_reg_seq_show(struct seq_file *s, void *pos) +static int mic_dma_reg_show(struct seq_file *s, void *pos) { struct mic_dma_device *mic_dma_dev = s->private; int i, chan_num, first_chan = mic_dma_dev->start_ch; @@ -707,23 +707,7 @@ static int mic_dma_reg_seq_show(struct seq_file *s, void *pos) return 0; } -static int mic_dma_reg_debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, mic_dma_reg_seq_show, inode->i_private); -} - -static int mic_dma_reg_debug_release(struct inode *inode, struct file *file) -{ - return single_release(inode, file); -} - -static const struct file_operations mic_dma_reg_ops = { - .owner = THIS_MODULE, - .open = mic_dma_reg_debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = mic_dma_reg_debug_release -}; +DEFINE_SHOW_ATTRIBUTE(mic_dma_reg); /* Debugfs parent dir */ static struct dentry *mic_dma_dbg; @@ -747,7 +731,7 @@ static int mic_dma_driver_probe(struct mbus_device *mbdev) if (mic_dma_dev->dbg_dir) debugfs_create_file("mic_dma_reg", 0444, mic_dma_dev->dbg_dir, mic_dma_dev, - &mic_dma_reg_ops); + &mic_dma_reg_fops); } return 0; } From patchwork Wed Dec 5 16:18:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10714523 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 0DC7214E2 for ; Wed, 5 Dec 2018 16:19:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F179E296D0 for ; Wed, 5 Dec 2018 16:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E51632DBF0; Wed, 5 Dec 2018 16:19:52 +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=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 7A38C296D0 for ; Wed, 5 Dec 2018 16:19:52 +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:References: In-Reply-To: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:List-Owner; bh=SFMBOgYri/K/7tw3cHJ1/3Jb1rRjDDe2XeXu2IW8/Rk=; b=C9G6Mt9kEAKBb/iH4X99Zfm1m0 SI31rbdJWTjgMz872KWPZPlP22d6UHBcG8mfaXfqq34LLimxxut80AMFFeGcdxAaNdjdKk68HSi0+ WSXcYHlh73fgPvAWnmRMbJVR7x/CRTHeqE2o+5P/GA2Humj7/wDc4QZX+hd8ac/baZZKeIkuyJIOe AOl0ObzJCKGuEivimQRYLziq8lGhZgqibtoiPSfRJG8oB15NGpPf3d6578gQ9ZbR6BW+WOiUHorqH IBg6GlfvSpUlQLrJyNIb3tCNYNwg1bxSIwG54DPfXZqsZkpy+WZZ7EPdCQRWMjcUi/7z2x0NrWyah T0DdDK4Q==; 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 1gUZtu-000536-7g; Wed, 05 Dec 2018 16:19:50 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUZtX-0004XG-Rw for linux-arm-kernel@lists.infradead.org; Wed, 05 Dec 2018 16:19:32 +0000 Received: by mail-pf1-x443.google.com with SMTP id b85so10256811pfc.3 for ; Wed, 05 Dec 2018 08:19:16 -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:in-reply-to:references; bh=v1dQ2p+wlJHnvgVjYXtksddQgKWwiQhuGWFNxVx0hU0=; b=O8MoydQ8bu5yH3IGdjAhrJyjGmnDk/357P9kJMcDbZB/pREEkjik3QvxOS8nQFBdp6 njry5vdtEJq3luMkbmN8YM4KP5G7fXxVhohi5FEqlzd6nN9WC9DJPB4z+OH+Lft/vsr1 KNO9dsxnyMeGS+sgrPs0yM5TIkp5XdmG5isGjVa9HTW44ijWM8+mJ0bkaM/BAeHdJPem npE9whVqclztUjli3S11SJMxAOn4z75gj938CCwqEE4NqIJ2wL86QbATX+lseZoywmK0 0pPgFpCCnkJCWaTUvB9Xz5kWql5Vxo9bd2HLdTQuF158+OMIJORYvRcRHix0MK3ZPLba RPAA== 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:in-reply-to :references; bh=v1dQ2p+wlJHnvgVjYXtksddQgKWwiQhuGWFNxVx0hU0=; b=C/YBykXt1v5U25wj9YA/A46majwMKnaYmmJ4HzIwNrNxbjAB490L6xeRmCL9Dbhttu KTw8DjKk6LRKFlah1EwmJmiw0AbTD6P7xMU26q6kHXguDSR0whUgbksEHTxktoA//d2b AdNHGsg4Vt9Dd7fpq7Lsi8ZjzuKH5sZANbtj2sBSESDGqlqkqgD42sAagZzPrQx/+FyY qsz0rNK6O3RqcGzWV1iGehL6yz/koPj+TzTjGGxh+gra1UxiZkq/r0VCvN0gJN9W9zEp u39rW9xKL9Na6nwBD2rfk3/ww8H0EO1A3GB39PscZQ5awLR99r1aOf0fxHMoDPAPkmAu JSBw== X-Gm-Message-State: AA+aEWaLCnrO8UbhJq9mEbHxb+Ha9TcIiEaI2NcNaQyOTE3uTCcG4Or1 AoPgP2oE9XZW+LMXTxlPHs4= X-Google-Smtp-Source: AFSGD/W0w2+Trnd5e1MgQZoMYzuj/aaMuoTd9y9BpPGEx6ZBSGqeQ8rAGc/1WXiAwBXVkBr2EFQxnA== X-Received: by 2002:a62:190e:: with SMTP id 14mr24887086pfz.70.1544026756215; Wed, 05 Dec 2018 08:19:16 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id v190sm30041298pfv.26.2018.12.05.08.19.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 08:19:15 -0800 (PST) From: Yangtao Li To: vkoul@kernel.org, dan.j.williams@intel.com, sudeep.dutt@intel.com, ashutosh.dixit@intel.com, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, okaya@kernel.org, andy.gross@linaro.org, david.brown@linaro.org Subject: [PATCH 3/4] dmaengine: pxa: remove DBGFS_FUNC_DECL() Date: Wed, 5 Dec 2018 11:18:59 -0500 Message-Id: <20181205161900.16434-3-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20181205161900.16434-1-tiny.windzz@gmail.com> References: <20181205161900.16434-1-tiny.windzz@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181205_081928_455376_4ADE8617 X-CRM114-Status: GOOD ( 12.30 ) 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: dmaengine@vger.kernel.org, linux-arm-msm@vger.kernel.org, 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 We already have the DEFINE_SHOW_ATTRIBUTE, There is no need to define such a macro, so remove DBGFS_FUNC_DECL. Signed-off-by: Yangtao Li Acked-by: Robert Jarzmik --- drivers/dma/pxa_dma.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 825725057e00..e78fe98b5cf1 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -189,7 +189,7 @@ bool pxad_filter_fn(struct dma_chan *chan, void *param); #include #include -static int dbg_show_requester_chan(struct seq_file *s, void *p) +static int requester_chan_show(struct seq_file *s, void *p) { struct pxad_phy *phy = s->private; int i; @@ -220,7 +220,7 @@ static int is_phys_valid(unsigned long addr) #define PXA_DCSR_STR(flag) (dcsr & PXA_DCSR_##flag ? #flag" " : "") #define PXA_DCMD_STR(flag) (dcmd & PXA_DCMD_##flag ? #flag" " : "") -static int dbg_show_descriptors(struct seq_file *s, void *p) +static int descriptors_show(struct seq_file *s, void *p) { struct pxad_phy *phy = s->private; int i, max_show = 20, burst, width; @@ -263,7 +263,7 @@ static int dbg_show_descriptors(struct seq_file *s, void *p) return 0; } -static int dbg_show_chan_state(struct seq_file *s, void *p) +static int chan_state_show(struct seq_file *s, void *p) { struct pxad_phy *phy = s->private; u32 dcsr, dcmd; @@ -306,7 +306,7 @@ static int dbg_show_chan_state(struct seq_file *s, void *p) return 0; } -static int dbg_show_state(struct seq_file *s, void *p) +static int state_show(struct seq_file *s, void *p) { struct pxad_device *pdev = s->private; @@ -317,22 +317,10 @@ static int dbg_show_state(struct seq_file *s, void *p) return 0; } -#define DBGFS_FUNC_DECL(name) \ -static int dbg_open_##name(struct inode *inode, struct file *file) \ -{ \ - return single_open(file, dbg_show_##name, inode->i_private); \ -} \ -static const struct file_operations dbg_fops_##name = { \ - .open = dbg_open_##name, \ - .llseek = seq_lseek, \ - .read = seq_read, \ - .release = single_release, \ -} - -DBGFS_FUNC_DECL(state); -DBGFS_FUNC_DECL(chan_state); -DBGFS_FUNC_DECL(descriptors); -DBGFS_FUNC_DECL(requester_chan); +DEFINE_SHOW_ATTRIBUTE(state); +DEFINE_SHOW_ATTRIBUTE(chan_state); +DEFINE_SHOW_ATTRIBUTE(descriptors); +DEFINE_SHOW_ATTRIBUTE(requester_chan); static struct dentry *pxad_dbg_alloc_chan(struct pxad_device *pdev, int ch, struct dentry *chandir) @@ -348,13 +336,13 @@ static struct dentry *pxad_dbg_alloc_chan(struct pxad_device *pdev, if (chan) chan_state = debugfs_create_file("state", 0400, chan, dt, - &dbg_fops_chan_state); + &chan_state_fops); if (chan_state) chan_descr = debugfs_create_file("descriptors", 0400, chan, dt, - &dbg_fops_descriptors); + &descriptors_fops); if (chan_descr) chan_reqs = debugfs_create_file("requesters", 0400, chan, dt, - &dbg_fops_requester_chan); + &requester_chan_fops); if (!chan_reqs) goto err_state; @@ -375,7 +363,7 @@ static void pxad_init_debugfs(struct pxad_device *pdev) goto err_root; pdev->dbgfs_state = debugfs_create_file("state", 0400, pdev->dbgfs_root, - pdev, &dbg_fops_state); + pdev, &state_fops); if (!pdev->dbgfs_state) goto err_state; From patchwork Wed Dec 5 16:19: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: 10714525 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 042F014E2 for ; Wed, 5 Dec 2018 16:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E525B2DBDE for ; Wed, 5 Dec 2018 16:20:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E30A32DBE6; Wed, 5 Dec 2018 16:20: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=-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=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 9C5722DBF5 for ; Wed, 5 Dec 2018 16:20: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:References: In-Reply-To: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:List-Owner; bh=XMQtJl5wPonYexU21p6YMvseCvUgTit/pH+dQ8mYl/s=; b=X7Cy6gb/tgKLrRsdGAjL4qjbG4 hAl1k9Z4bEHrqJ/tW1Aa9w8rQA1nZnqnLAHDFJq/+9Ho+o6C3RCiYkGe3QiYaFGb0izWVv2cQwhxc lo2cpOGlt/GuGQNycaAzd0uZ4VIlGgcuf8zWGBO8NdoKuC3/a7cT2AQ6bIcpqfuwu+tVwn081nfrI iDFJDgvs1XrWSsm1xm4B0KlsEL+BcqXRGYh2B2COu+rxVVShVqSPiHt/ig2UGgFwir2kJbz6+Cxzx X/twDZOb8YZhz+KsVogJeV3yRY6LdfGSPky/MlHofc1exIAxMWFNJ4HHpNWDjChHwKVmrdtl9acTh FL7FIWeA==; 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 1gUZuC-0005We-50; Wed, 05 Dec 2018 16:20:08 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUZta-0004Xd-IN for linux-arm-kernel@lists.infradead.org; Wed, 05 Dec 2018 16:19:41 +0000 Received: by mail-pf1-x441.google.com with SMTP id c72so10239036pfc.6 for ; Wed, 05 Dec 2018 08:19:19 -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:in-reply-to:references; bh=U5AyLvvPtL5q9Hq4lLjNeXGltOkPp9aVeP+7Rj9S6G4=; b=pZ/O66767u/rju7GV0hExJzk4xER5YpDmZBVbLQR1ZPXoBifETBSmkHWjhuxoMk0tt 6EL2v4x6RYeLQ1k/2gESxWcg4UNPGaZLJhE9IuxaYZf3Li974d3yYYEb6mETlQ+I7PsE Vfb4Ro1ynCGwsetRSyuqcEv0ybE7hOjh+DYS0gIBX4sEZuqc+39U4k437HaaBAEKk83m Vlrz+A1madK3qDoef9UdDzp0YA0jUjsUurLPIk3g70ALBFr36w22qyFMcaUmZr2nhCSr igm5OoCmvzl4vorfgzH3YZZK7G7bkzZqIUGWDbxCoRZefotnEIvsAqs2rTJ5y3oQtaQW 3gSw== 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:in-reply-to :references; bh=U5AyLvvPtL5q9Hq4lLjNeXGltOkPp9aVeP+7Rj9S6G4=; b=gr1K8QfYf6WmIgRxk8t/jHNkwxAJWXpoCh6jnXMDOTJnoUnyAuzsPeUmaidpC7Mex1 v72i1Zx1OqkdoEasWMhUjeQeVf8ZV5m2aDzAVIeMauHKu9VkX0p0Z2rPG/ve7s71pdm7 en4rRMtpaipq500xGkIDLW5ijZpzcd3zDx5UCceBAfcfhRNjKFYTRkAMN6UxgWS0jVhZ xb4yhFy+rrJRQ/NpVCdiGvMVSs9rdkOAEPPYY/FzbLzw8qpFcOmdUk3DLSiXlu3i9uJi bmoXCT+/EhbrbiYdxyxhrYhMjnpAuNVmnX0BBn1MlOR1mraXEAwH5MfEhvw3E5fNIgfR Gw/A== X-Gm-Message-State: AA+aEWaBkV58yx/dTFK8X7/M3j3Ipv1E7eoAih3lBv6Tk0TuDZaBcJSX +ky9oSbW8DeFRSuSd/7Q02U= X-Google-Smtp-Source: AFSGD/XRuMnsK25fid0v5zdBmNLshJ9g2ojqO8x9OsAVhaID02pKR/H65XtOEy1CVvhAsOp3pOucnQ== X-Received: by 2002:a63:5907:: with SMTP id n7mr20874313pgb.435.1544026759113; Wed, 05 Dec 2018 08:19:19 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id o7sm26868095pfb.34.2018.12.05.08.19.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 08:19:18 -0800 (PST) From: Yangtao Li To: vkoul@kernel.org, dan.j.williams@intel.com, sudeep.dutt@intel.com, ashutosh.dixit@intel.com, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, okaya@kernel.org, andy.gross@linaro.org, david.brown@linaro.org Subject: [PATCH 4/4] dmaengine: qcom_hidma: convert to DEFINE_SHOW_ATTRIBUTE Date: Wed, 5 Dec 2018 11:19:00 -0500 Message-Id: <20181205161900.16434-4-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20181205161900.16434-1-tiny.windzz@gmail.com> References: <20181205161900.16434-1-tiny.windzz@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181205_081931_320495_A24471E4 X-CRM114-Status: GOOD ( 11.40 ) 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: dmaengine@vger.kernel.org, linux-arm-msm@vger.kernel.org, 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 Acked-by: Sinan Kaya --- drivers/dma/qcom/hidma_dbg.c | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/drivers/dma/qcom/hidma_dbg.c b/drivers/dma/qcom/hidma_dbg.c index 3bdcb8056a36..9523faf7acdc 100644 --- a/drivers/dma/qcom/hidma_dbg.c +++ b/drivers/dma/qcom/hidma_dbg.c @@ -85,11 +85,11 @@ static void hidma_ll_devstats(struct seq_file *s, void *llhndl) } /* - * hidma_chan_stats: display HIDMA channel statistics + * hidma_chan_show: display HIDMA channel statistics * * Display the statistics for the current HIDMA virtual channel device. */ -static int hidma_chan_stats(struct seq_file *s, void *unused) +static int hidma_chan_show(struct seq_file *s, void *unused) { struct hidma_chan *mchan = s->private; struct hidma_desc *mdesc; @@ -117,11 +117,11 @@ static int hidma_chan_stats(struct seq_file *s, void *unused) } /* - * hidma_dma_info: display HIDMA device info + * hidma_dma_show: display HIDMA device info * * Display the info for the current HIDMA device. */ -static int hidma_dma_info(struct seq_file *s, void *unused) +static int hidma_dma_show(struct seq_file *s, void *unused) { struct hidma_dev *dmadev = s->private; resource_size_t sz; @@ -138,29 +138,8 @@ static int hidma_dma_info(struct seq_file *s, void *unused) return 0; } -static int hidma_chan_stats_open(struct inode *inode, struct file *file) -{ - return single_open(file, hidma_chan_stats, inode->i_private); -} - -static int hidma_dma_info_open(struct inode *inode, struct file *file) -{ - return single_open(file, hidma_dma_info, inode->i_private); -} - -static const struct file_operations hidma_chan_fops = { - .open = hidma_chan_stats_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static const struct file_operations hidma_dma_fops = { - .open = hidma_dma_info_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(hidma_chan); +DEFINE_SHOW_ATTRIBUTE(hidma_dma); void hidma_debug_uninit(struct hidma_dev *dmadev) {