From patchwork Mon Nov 5 14:37:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10672909 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 4D3EE13BF for ; Wed, 7 Nov 2018 18:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D4C82CD8C for ; Wed, 7 Nov 2018 18:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 316FA2CDBD; Wed, 7 Nov 2018 18:57:23 +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=-0.3 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94D3D2CD8C for ; Wed, 7 Nov 2018 18:57:22 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 581A12678DD; Wed, 7 Nov 2018 19:57:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5D046267930; Mon, 5 Nov 2018 15:37:41 +0100 (CET) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by alsa0.perex.cz (Postfix) with ESMTP id 605412678DD for ; Mon, 5 Nov 2018 15:37:39 +0100 (CET) Received: by mail-pl1-f194.google.com with SMTP id w22-v6so1230321plk.0 for ; Mon, 05 Nov 2018 06:37:38 -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=z1zzkMTBEehskq2DPI3ZOQHaUdaoniARDpLAtPnVMgI=; b=bcRa1JFQfrDvxrCBswxmSbgeYFdHnqGGnLHq2506hoD518rVvfi+ArtX1yOrjsbBOr cKS4HHPs61TUaDKK7hcxEbfjeW/bO0GYRZtTTL7CEE2ZT48mdh81NSlaXTehVuVKrH2A aUC+SXnaJ5EQzeuG1htRreOwDDxM34/VaDgYrdpDhyXx/UAS9W2mUgvbPXrY/qlwRSXe Jf8QX+yZM3Iif5ZajdGd4heLQI/thOmMxfwWQ6U/BOTuLA9foA4fLBbBN6UOsGQ4lvfM HDmZf40WMracLCha0dmE/WtRdwKj8E7JkPiYKf3c6xT4jBbfIjUw/GXYFCYFa44UhT5G F9WQ== 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=z1zzkMTBEehskq2DPI3ZOQHaUdaoniARDpLAtPnVMgI=; b=Bs4oA5TSTHUm73x3hhAWyuP3OlNL3u6k1bTGP8UDqsBIwgmE0l13Gc+3MbBMlAuCdO N59AN4K8PCkrJxhKLVaLXt8F4tEWUJ5EqAddjwt9SCccI/L2EDLt8j1cgLeuNm+O3ZXe jvuG0RTUKqkwy8f5tE5fAcLh7jwIj6Bvp9se0geholltMuWqT4Q+TDIpkiYiTxi5k5jm A9iPpW7+fdwv7EwkRwsvOisgkl/nJ0vtQzXrxnPu8kG/hISMoJdyD6oJnZRntulLq4wQ jWld0vNy4JV+YBStSxTooa3S7ZypkLJS8djy5Zh3qweNlGw2KAD16O/cxc1kFxhW6xbR S6CQ== X-Gm-Message-State: AGRZ1gIL0vyIFQH0wjIITaVOVe69LZswZAxAJmkJv3LqbtA2WhjHxuHF v00cS91bYtf6TgWtntfIArY= X-Google-Smtp-Source: AJdET5eTxjVAXMLDVPHzELPZyCSMhaRrkGRajUG1ti+DRfkoiQVOCYE9rTqsYzy/8E/MQUnwlQ24GA== X-Received: by 2002:a17:902:b183:: with SMTP id s3-v6mr21194163plr.70.1541428658045; Mon, 05 Nov 2018 06:37:38 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id o27-v6sm57166297pfk.85.2018.11.05.06.37.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Nov 2018 06:37:37 -0800 (PST) From: Yangtao Li To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, fabio.estevam@nxp.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Date: Mon, 5 Nov 2018 09:37:30 -0500 Message-Id: <20181105143730.6071-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 X-Mailman-Approved-At: Wed, 07 Nov 2018 19:57:08 +0100 Cc: Yangtao Li , alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: fsl_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Reviewed-by: Fabio Estevam --- sound/soc/fsl/fsl_ssi_dbg.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi_dbg.c b/sound/soc/fsl/fsl_ssi_dbg.c index 1255dfe19eef..6f6294149476 100644 --- a/sound/soc/fsl/fsl_ssi_dbg.c +++ b/sound/soc/fsl/fsl_ssi_dbg.c @@ -124,17 +124,7 @@ static int fsl_ssi_stats_show(struct seq_file *s, void *unused) return 0; } -static int fsl_ssi_stats_open(struct inode *inode, struct file *file) -{ - return single_open(file, fsl_ssi_stats_show, inode->i_private); -} - -static const struct file_operations fsl_ssi_stats_ops = { - .open = fsl_ssi_stats_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(fsl_ssi_stats); int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev) { @@ -144,7 +134,7 @@ int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev) ssi_dbg->dbg_stats = debugfs_create_file("stats", 0444, ssi_dbg->dbg_dir, ssi_dbg, - &fsl_ssi_stats_ops); + &fsl_ssi_stats_fops); if (!ssi_dbg->dbg_stats) { debugfs_remove(ssi_dbg->dbg_dir); return -ENOMEM;