From patchwork Thu Nov 22 12:59:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10694133 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 EAE7713BB for ; Thu, 22 Nov 2018 13:00:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D713C2C9C3 for ; Thu, 22 Nov 2018 13:00:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBB7A2C9FE; Thu, 22 Nov 2018 13:00:24 +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 D99FE2C9C3 for ; Thu, 22 Nov 2018 13:00:23 +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=JuTimIvcJjK5vZ9qPFSEEIkUKa0mFDs1SHPnDs0YiUU=; b=dpN d2ZbPYcp8pKvHR2fZ0V+15jK33vfxEz6a0PPuZeGjKd+BEjdIiaPIu9hVlwN9zo3aw//4Mz3SzZ9r BjMNwbOpcQgtGSZdrsET/SYUlw/V/kEFrAXoOMKvjHvcHwMHkpoTNB50dDhI9hmq61qT4rk+cHY4+ 1EvKD13AB8mn0CbuY8j98gsqZETOXVVrPzyuUycd2E7T+2xXF6TTEL1t2V2KRS71E4pDH5xmriUdG ukjp6mnqTUGgrJgUfMl9tBWK1fPOw0t26BN5MucnpNNqjHYvw2u4IGWAzXAYYDAj7VnWjtLh4Sy9d jIlfwOg/CeI+/N/Wk8HWKLvnPlYFJmA==; 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 1gPoah-0002Or-Qh; Thu, 22 Nov 2018 13:00:19 +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 1gPoaJ-0000j1-Co for linux-arm-kernel@lists.infradead.org; Thu, 22 Nov 2018 12:59:57 +0000 Received: by mail-pf1-x442.google.com with SMTP id c72so1931563pfc.6 for ; Thu, 22 Nov 2018 04:59:45 -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=NvORi37yejSIkLk6y0OD0wL76jkqOTihkurM9dCYMsQ=; b=QtVcSaKgwzfZuOdMPe2gv793OZev9HwJ2Ee6QVGpnokLSOWYxsHoWUDZIg6NhZkgJz LTT99B+oPiyqW4mad5WEdK9i52W7pw6RK2L+UAjC8olmaOEZIbZe1LT1UjKwvc/+JcPF 8fJK/Cch37lUhV0TSyoI2+RVHGJIpttSXTxcdrV8rHLnO1JPIG5LeyEoDtXLqgRMvqNd PY1o7gRvORUPZT3WV2IxI4ZepF6q/9hUoLZINIiPM0f9tiOR/z16+75jbZ/oG7UulqIl I8caMm04O9TE+dY6OdNBpzCqGplxNjTEqfFwH9pFZKsJMBfXyyTUE/IxIl/VahfDM8ZO 2Ghg== 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=NvORi37yejSIkLk6y0OD0wL76jkqOTihkurM9dCYMsQ=; b=HlvnHo/ETcEGVApo18R7jOIMqBauroQ5Fuu53PnBZ+oxzIP/UvclCGdvP2bwCWLhcI rN6f/qYDtDVJTrV2LawMQLGsiujuEIzLrlZvkk83p4iQDiv4i2yPezefdUJSRj/LRY0/ Sl9qrkbNykvtlftA4OBhjo03oemeHUdIrDA3x8v2GqmEcNPjcyF2U6nD0VV4fps0TIiT NudARpRz3lXLON6ieF25fWD9/JXNZbmOQd5wAj5oRBlBfq6fTjroCWa7qpaFrLdavVZM F/Jaii360BxxBmLj/3ydr8HrupsNoFlpvjxDDSJEYQiS/Sp3Ccmfw4vbuZv6/Sm+BBPq /0Pg== X-Gm-Message-State: AA+aEWZflhoQmTJaf0f4t5Q0/2QrJNagtz+K9BGG7ImMXpy+3dZyEDIb Sulz56sszp8pZtASyrtf1i0= X-Google-Smtp-Source: AFSGD/Uyxmm1uydXk1v0EwwaBn6m3HLHUhGL61MkMobkfsn8InMT21iZaOOUZpYtkMWCohNXFFjA0g== X-Received: by 2002:a65:47ca:: with SMTP id f10mr10242756pgs.166.1542891584937; Thu, 22 Nov 2018 04:59:44 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id f13sm33270098pfa.132.2018.11.22.04.59.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 04:59:44 -0800 (PST) From: Yangtao Li To: maxime.ripard@bootlin.com, wens@csie.org Subject: [PATCH] soc: sunxi: Change to use DEFINE_SHOW_ATTRIBUTE macro Date: Thu, 22 Nov 2018 07:59:41 -0500 Message-Id: <20181122125941.24615-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_045955_676969_8430AA1A X-CRM114-Status: GOOD ( 11.43 ) 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/sunxi/sunxi_sram.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index b4b0f3480bd3..71e3ee4a3f19 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -155,17 +155,7 @@ static int sunxi_sram_show(struct seq_file *s, void *data) return 0; } -static int sunxi_sram_open(struct inode *inode, struct file *file) -{ - return single_open(file, sunxi_sram_show, inode->i_private); -} - -static const struct file_operations sunxi_sram_fops = { - .open = sunxi_sram_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(sunxi_sram); static inline struct sunxi_sram_desc *to_sram_desc(const struct sunxi_sram_data *data) {