From patchwork Sun Dec 2 04:14:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10707831 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 7DCFF1057 for ; Sun, 2 Dec 2018 04:15:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDD452A609 for ; Sun, 2 Dec 2018 04:14:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E119A2AD79; Sun, 2 Dec 2018 04:14:55 +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 987B72A609 for ; Sun, 2 Dec 2018 04:14:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725308AbeLBEOx (ORCPT ); Sat, 1 Dec 2018 23:14:53 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36114 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbeLBEOx (ORCPT ); Sat, 1 Dec 2018 23:14:53 -0500 Received: by mail-pf1-f194.google.com with SMTP id b85so4730029pfc.3; Sat, 01 Dec 2018 20:14:50 -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=ItWw9xV0OZ0rLJ2VN73W7xJ7ddl7sTO8Ach+wndptXA=; b=PuPEPSe+EoL8YSzOUedlI2qT8PltTleyH8iFa7+K4awDYo690mv31yYustUguNqsBr 4WdY6JWZhA5XHhISI7BC1TMiZu7bfOiNYT/PQDHeNSjrEBTKcBNCK4TWO++az/m67d3v VuYpHKU3PO/v4Vx0VaWUMzoQF6BdxoLyekRUZYCCScbEXcgtUK0pVXvz8uzPGJpPKOxs IXkQBdfA3Dy5wJswVd9Oa91/dlCLumY+h1jxluSymq+PHK/flbBPFKxrPe//w2YkaAnW r81euVvdfPirMvS6umc9i23zUwbf7180cU/VrIyktbYp7g1EuJUSI4dP5m/a2H2Z7Akw dLmA== 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=ItWw9xV0OZ0rLJ2VN73W7xJ7ddl7sTO8Ach+wndptXA=; b=HHVEZCrR7dpZ0pFngI0Jr5fbLnrVwVjbAyEZ61wqrBhoB36pnN1EcGdf2WLp8aWEuz +n1ot4HpjudERTTqZqDbbAoGnO6FXKwMhcyD1d8cI6CjZ3CvqfKQjLuqWVsTNaXqchzp FeQOGlW49WSwdcqfNzMTT2XVSOIxo5Jihnlp0tfHDsT8LOa43ba6t8UH9q5PEDOL0l02 pnB0V9pQoPWCryoaCj2qEQtxUmdTHbIKQCFGFsuoDo7vDDkHmTrVL0Ob16hrSvhdr5KR rmOtnl3/DZ3Bt6EEbxrHv7bh4BqihyuZkplqGz/GpBiIIzi7ztX9CctVH0wXVRgKjJhR xGsQ== X-Gm-Message-State: AA+aEWaKaZrxETkyq+R9ffflswe4IlHSzEaA8Elt6MsPhvyp/Rl1dh+c X9DGIcxvXdo9LAZGzruvxAE= X-Google-Smtp-Source: AFSGD/VbEpjDDYMmogLC9/EwJuhKnaZilzfKot9IgplrwKz7SVrpC/cPGL1KywOgZypOmz5mf2SEPA== X-Received: by 2002:a63:8742:: with SMTP id i63mr9344669pge.298.1543724090593; Sat, 01 Dec 2018 20:14:50 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id m198sm11087043pga.10.2018.12.01.20.14.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Dec 2018 20:14:49 -0800 (PST) From: Yangtao Li To: b.zolnierkie@samsung.com, fengguang.wu@intel.com, mchehab+samsung@kernel.org Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH v2] media: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 1 Dec 2018 23:14:48 -0500 Message-Id: <20181202041448.10049-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li --- drivers/video/fbdev/omap2/omapfb/dss/core.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c index a5e58a829ea0..b4bcf3a4a647 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/core.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c @@ -99,24 +99,14 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput) } #if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS) -static int dss_debug_show(struct seq_file *s, void *unused) +static int dss_show(struct seq_file *s, void *unused) { void (*func)(struct seq_file *) = s->private; func(s); return 0; } -static int dss_debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, dss_debug_show, inode->i_private); -} - -static const struct file_operations dss_debug_fops = { - .open = dss_debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(dss); static struct dentry *dss_debugfs_dir; @@ -130,7 +120,7 @@ static int dss_initialize_debugfs(void) } debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir, - &dss_debug_dump_clocks, &dss_debug_fops); + &dss_debug_dump_clocks, &dss_fops); return 0; } @@ -145,7 +135,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) struct dentry *d; d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, - write, &dss_debug_fops); + write, &dss_fops); return PTR_ERR_OR_ZERO(d); }