From patchwork Thu Nov 22 13:07:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10694137 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 449B813BB for ; Thu, 22 Nov 2018 13:08:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 350BA2BD7D for ; Thu, 22 Nov 2018 13:08:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28C312C2D8; Thu, 22 Nov 2018 13:08:04 +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 B2A622C1FA for ; Thu, 22 Nov 2018 13:08:03 +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=/2Lq/IYAj0hRoeypLQ7B3w13HUFmmyY1/9oF9CrcZCg=; b=Q8S BujcPmRadi98ZDeGRU7V8GFSOWKYge/IvzAFZrl7Kod8acms0jqzN4rIJiaRSZaooKxHNKeuiOCd1 jIGyb/lSH+avqhfIBXOZFvOdRfYKMjhdbQQ5JB+ZwJuvzI7G8/se3nY/UurEBO8Ab+K+UDmoQPSPV b8/ttrn4/FmCpXmi9LmPI7yMqAe7Tlz0CAhbdYNZOFd+nqExNWg7noFkHsiJ5AjMzK4m3nol3gQ0J rumtAyY8ASsNhcg8HsPx0NRtc1fQRv6Omk153FHuLb7fpGPMrJZ94Jzh7OFglxInnBsiIluQXxqDd AdbVlpIitqYxACpbpj3fDDFVyMypr4Q==; 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 1gPoi5-0004WX-O7; Thu, 22 Nov 2018 13:07:57 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPohy-0004Ms-K0 for linux-arm-kernel@lists.infradead.org; Thu, 22 Nov 2018 13:07:56 +0000 Received: by mail-pl1-x644.google.com with SMTP id e5so9258794plb.5 for ; Thu, 22 Nov 2018 05:07:40 -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=nxOOxLheUCjG33KOamsBUmgiVbATibex+BZnh/eKLHE=; b=lshLQWrcxS5QKjjes/gbw9+oO4Zp+21+u+i/Hgv1aIZIb1JpvhLulfboUKqmwU1U8K ZAL/1XCkcHclDWzw+DzyG8tBfqCRBjPYO82JYzpVQkUUrqiIzA3MPP91Ecu7evenvrFt TEn4D8cyu9vYBUQhTbc70rvq9RnXdeTfWn4qBBUGGl5iRENLAuFtiSCQtdeVG2/2y4pw MiwgB0Cs9eKP0RcSSHaNSW4IT7UVEPkIrzx3x0oRhSrFk4g2H7mmyV/u0gEjJncUtH/+ JLw2FfQUW+JluI2SWYMidSMzrXzP8ZQ1rr1/zjbfyaGZcqHcDt+Po2KKacgdCv1FYaOe Zd1A== 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=nxOOxLheUCjG33KOamsBUmgiVbATibex+BZnh/eKLHE=; b=gbcWex8mRKZz+LzjLguN7GLgG+9BxqywxIBEdTz4FRumL+3cgopj16W14WIbLYElfk Doc1zOQuzsfHFJqf88fFp3hWgKLwlvfcdaidfcT7nLg3rU11LaA3UjEpSeHqKTbiJOkd /Dj+00HiLtMtUAiMR8d5X32e5VHCvZ7lJBNs1XEeRJqGHiHGNDeBy1J1+LbYY3CBMGey UftehMyLlU12bdLyUVYtzaDOZRlGrrz2t7gNGTWGTbVAtVA8fGKBNHAb6IxFEpoR3aVD iAS0BD49clVQOv7wsaweY5M85Qht8uQ80TECVaQzQ5Ecf8eFPi42eGlEi5Veerbm+mVK 1rQg== X-Gm-Message-State: AA+aEWa72Evks4OTsJXrI2Wlzc1RnSe9Fqzd5CJy16rb0WQVJbTHgqDx ikIoGZGi60fUNCngoz+m710x1Y7HOQE= X-Google-Smtp-Source: AFSGD/Vff8QKhbhofBJZS+vbKdhhUBjnMdaRprK+aTUFUcdGw37eeXyXU3F2BZ0zMTKnsl6xHQ9mWw== X-Received: by 2002:a17:902:144:: with SMTP id 62-v6mr10878102plb.142.1542892060080; Thu, 22 Nov 2018 05:07:40 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id n13-v6sm74628717pfk.19.2018.11.22.05.07.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 05:07:39 -0800 (PST) From: Yangtao Li To: ssantosh@kernel.org Subject: [PATCH] soc: ti: Change to use DEFINE_SHOW_ATTRIBUTE macro Date: Thu, 22 Nov 2018 08:07:36 -0500 Message-Id: <20181122130736.24703-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_050750_658305_7E8AA5D1 X-CRM114-Status: GOOD ( 11.64 ) 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_dma.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c index e05ab16d9a9e..2a66f36b9fd6 100644 --- a/drivers/soc/ti/knav_dma.c +++ b/drivers/soc/ti/knav_dma.c @@ -355,7 +355,7 @@ static void dma_debug_show_devices(struct seq_file *s, } } -static int dma_debug_show(struct seq_file *s, void *v) +static int knav_dma_debug_show(struct seq_file *s, void *v) { struct knav_dma_device *dma; @@ -370,17 +370,7 @@ static int dma_debug_show(struct seq_file *s, void *v) return 0; } -static int knav_dma_debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, dma_debug_show, NULL); -} - -static const struct file_operations knav_dma_debug_ops = { - .open = knav_dma_debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(knav_dma_debug); static int of_channel_match_helper(struct device_node *np, const char *name, const char **dma_instance) @@ -778,7 +768,7 @@ static int knav_dma_probe(struct platform_device *pdev) } debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL, - &knav_dma_debug_ops); + &knav_dma_debug_fops); device_ready = true; return ret;