From patchwork Fri Nov 23 14:50: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: 10695989 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 AF81213BB for ; Fri, 23 Nov 2018 14:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DCB72BDAF for ; Fri, 23 Nov 2018 14:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EF0E2BE10; Fri, 23 Nov 2018 14:51:05 +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 2EE752BDAF for ; Fri, 23 Nov 2018 14:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391456AbeKXBfb (ORCPT ); Fri, 23 Nov 2018 20:35:31 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45085 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389110AbeKXBfb (ORCPT ); Fri, 23 Nov 2018 20:35:31 -0500 Received: by mail-pl1-f194.google.com with SMTP id a14so10732153plm.12; Fri, 23 Nov 2018 06:51:03 -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=voownpDEuyOtOySXWnXP++MLmz0fNIioGWXEuqsg52c=; b=S/QoltaEpZZnq+ZUi9VdcxTJrS946b8xXaGIof4zcNe3kvv6jqBz5KiRWR1jvZVWh7 qLcjKftWKSKG+E2BA+5OBJ937vaYlFFpSk4mZHRHD59MLYDSZJnYB5UGGdIKSEdZc+3y rtzi7gUu/rz7wcx0uuYMxz/ne64uGLADu/KZf5+/v9N1Vo3XVrMagXdVycMlo7XGuHD1 TPyska0GcwG7vAJte5ECTSsbbWeJRd617W74hb3YFLFC6PF3GWp8G6qbDb7Yz+urT59S 6g4tz0Ctxb5jhytTiDrLmwWaoGbmSHwUHudbUyeLpzesXgmx4NcBkps0CPd35XU1QM9M XK/g== 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=voownpDEuyOtOySXWnXP++MLmz0fNIioGWXEuqsg52c=; b=QuXQqqB5lOTns1/22fjnmJpJHue8TTSrbJOl9DzTjjeXQHuIQHH+siTI5vyc1NciBe 6o+Snq/OXWcjEf+r5/4+Il8043HlDpCT3GbQNk6hlOOUcsKqPrrlDVQfqZ69O66BoN4F fEec7KDkewgAfrxq7lnha44spfN1aJKoAeuUZ1LUIRva4kvJHIP+ur4NZKFNZfHBAcxj W/3zZdj+w73gVwVLCLX2xnNyKxV5lMlkUpzqToviyOluhv45ndck5uVgSDAvsLOeUJlH DlLwk62FXPOXK1Zsb9GAENT5dWOHCTxspWrt6+24CNP6jB+ZdvV1aYadRWCSIRAuMSCQ kDEg== X-Gm-Message-State: AA+aEWbg/O+7FxZICMyUCXap1IOxf4QQ+pAxIyrwhCI/vU/0GG9P69SD GeiJOLAY8snSDCHnB6vgY8M= X-Google-Smtp-Source: AFSGD/XzJl/m00r7b/fzau4oRQc0kEjH5p+FzhSfmOfGzPNFNA3UbfBu0U+ejj/yk+P3Z4f+FYAF7A== X-Received: by 2002:a17:902:6948:: with SMTP id k8mr15791340plt.2.1542984663430; Fri, 23 Nov 2018 06:51:03 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id o1sm75869324pgn.63.2018.11.23.06.51.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Nov 2018 06:51:02 -0800 (PST) From: Yangtao Li To: rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, thierry.reding@gmail.com, jonathanh@nvidia.com, keescook@chromium.org, nicoleotsuka@gmail.com, ezequiel@collabora.com, srplinux2008@gmail.com Cc: linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH] thermal: tegra: soctherm: Change to use DEFINE_SHOW_ATTRIBUTE macro Date: Fri, 23 Nov 2018 09:50:58 -0500 Message-Id: <20181123145058.27115-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use macro to simplify the code. Signed-off-by: Yangtao Li --- drivers/thermal/tegra/soctherm.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index ed28110a3535..45b41b885f49 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -803,17 +803,7 @@ static int regs_show(struct seq_file *s, void *data) return 0; } -static int regs_open(struct inode *inode, struct file *file) -{ - return single_open(file, regs_show, inode->i_private); -} - -static const struct file_operations regs_fops = { - .open = regs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(regs); static void soctherm_debug_init(struct platform_device *pdev) {