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: 10714503 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 93A0314E2 for ; Wed, 5 Dec 2018 16:19:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8274B2BDEC for ; Wed, 5 Dec 2018 16:19:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 765BB2DB90; Wed, 5 Dec 2018 16:19:09 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47C462DA96 for ; Wed, 5 Dec 2018 16:19:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727620AbeLEQTH (ORCPT ); Wed, 5 Dec 2018 11:19:07 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36837 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbeLEQTH (ORCPT ); Wed, 5 Dec 2018 11:19:07 -0500 Received: by mail-pl1-f195.google.com with SMTP id g9so10300556plo.3; 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=G4gTXbJrzeTkg66u42A6ZQE0g+lBY9WVGLYVINvhO+X8zRrRgT8O552txVnVaIVIzZ iAD9JLiwxYBww1oYVxYCM9R1+vqHoWO6VjCXgCu0B01x7FlvPQzSCVl7ibvUKnC/aSqV FA2v8Fc2dC3Z063+jYDSsKIyETzpX8mqVV103RVzF0Xxu7KF+ylKHXttr7qYAA8u9hEG swgZRikyMXl0ccRyr2Vt/RgloiVc8gCedQEidNtagpRKFDJeKeNW187PGQDAax+/xDu2 u+PaMOfBVnNfKbhyQBp30bCHgvd/PWz9bY2v37Eh5RzLlZtVxgq9U+uan4tu3Nj+imH3 wGtw== X-Gm-Message-State: AA+aEWaHmvJi58zOBstSl5cnHqNaYTA+kYYBBxE+xsOG001ngY3/tiup l2SRNVo8dLvQ6AznG2ptBz0= 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 Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Yangtao Li 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 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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: 10714505 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 83DF11057 for ; Wed, 5 Dec 2018 16:19:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 729E6296D0 for ; Wed, 5 Dec 2018 16:19:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 660B72D768; Wed, 5 Dec 2018 16:19:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11E0A2D93F for ; Wed, 5 Dec 2018 16:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728151AbeLEQTL (ORCPT ); Wed, 5 Dec 2018 11:19:11 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41986 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbeLEQTK (ORCPT ); Wed, 5 Dec 2018 11:19:10 -0500 Received: by mail-pg1-f194.google.com with SMTP id d72so9232009pga.9; 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=VVE9rE1HALY7aCkO48WBkmy2IoxVSS4if1GU3eACvoqVKD0ZN45Mq0YYkbFQQGs970 FfmXplc/y1KkaCf1SB+l2Eb5XCTF89GX1aYpZ8jmiuBoGTqRxxYN7x4iymF8ce2yoKMz A8KyrGZZgx5FyaHM2Bds+eH9XOX+278zcIDv/+rCJqlTRrs0sxzw/R+TL7VeuzD2CRVB BBp1jnMJRxvP282lqLTYeB7sKVvS39IwWrbakyKoaf2aVqz0I8Oczl91tDJz9XX6svVk gptF2ITGsr+ZamDPcFOGJr1rvWEPYVHQwWdL0FNtF3u3gKnm330JQovPKZFq4jjCSHN9 43uw== X-Gm-Message-State: AA+aEWYj/lh6pcSQ7eULIStMux17dy/iyHsReWBBVJ6rgXFwnkae5YB2 wjiPrQSK13u+LwZZTfVPRnP0lS2auLY= 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 Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Yangtao Li 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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: 10714519 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 29F7D14E2 for ; Wed, 5 Dec 2018 16:19:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D7282DBAE for ; Wed, 5 Dec 2018 16:19:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AF072DBCC; Wed, 5 Dec 2018 16:19:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8D412DBAE for ; Wed, 5 Dec 2018 16:19:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728268AbeLEQTS (ORCPT ); Wed, 5 Dec 2018 11:19:18 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40923 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbeLEQTS (ORCPT ); Wed, 5 Dec 2018 11:19:18 -0500 Received: by mail-pf1-f194.google.com with SMTP id i12so10234892pfo.7; 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=LvXga/d48HHUuUT+pe3t9EsofhEB6dpcAXwU2OyeATbQYuqzSHOc8UrU5nb63DIlwY 6SX9yTDkUEGYIlGVPfGYFeHQ/XgFqaKkEkHGbC+hkP7dZWJXDfdnMJVioqaCw9jzZ9It TBbVVZkJzuOQRh3aehpWbSyLYHsKMFlwil5PdodLXBpsdfeGhThlxtLfaMPXTd4QEb02 s9xMYK+rH2chI59Gm5xTsiKs7jFgptHoKXLzCi4Yyi8Q3x8jHLopEv2ICnuY+c/QyB2o MXU/MV1zR9bH5kw5ZuPajvJUmd6iA33ZEe5zXj41y9iHqjQ3oe+dMiGT2GgXaxZq4PqQ bsoQ== X-Gm-Message-State: AA+aEWZXDluGLYcSPXkFjLW44RewzW/zpbyBswgqzM0rd1QCeBDR+AKY I3Xg1yZfndJ1kwhBwK45ldA= 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 Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Yangtao Li 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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: 10714517 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 81FAB17DB for ; Wed, 5 Dec 2018 16:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74C762DBBD for ; Wed, 5 Dec 2018 16:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68E7D2DBAC; Wed, 5 Dec 2018 16:19:28 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19C3D2DA07 for ; Wed, 5 Dec 2018 16:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728305AbeLEQTV (ORCPT ); Wed, 5 Dec 2018 11:19:21 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33755 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbeLEQTU (ORCPT ); Wed, 5 Dec 2018 11:19:20 -0500 Received: by mail-pf1-f196.google.com with SMTP id c123so10255381pfb.0; 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=V9GgYXRt9aIY9mVJsQL7mcJXt1tEgVDvy/eJXe8YT7bcg7mpSKsFgNp5tS/ZHe15/V LpnSZI/WlR27eDmDdNECVk2qBjyU2Epi5T99VZDaa7ejJhKmWQ/LgryXrJg2x9tlkhKW jk1t5C4G8BEmLrT5eXC+OafGI2cyMEu8mZ5Q5crg1bQTS8zA8ONnY8k5CuKuZ07mpmfg gV9XM5+2CJ11j/0/ONuzLYUGK8ew5zAtmW/Rz7xLftWRV13u3duexZtX6AveB6s0qJoy BS8F6kQtMXKxmiPnzlJeWsuUkQsQv+5Zb++N14nuyRKeMzOAame9cAHp1gqtrCjNdoYt gTmA== X-Gm-Message-State: AA+aEWbIakW2hflboLVTH+FTznMClRSkmcXMUl/ycsHiy3+VElS1oPzu uFQS78FqHoc3srlKrlXCVE0= 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 Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Yangtao Li 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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) {