From patchwork Thu Dec 12 14:44:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3332441 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A72679F374 for ; Thu, 12 Dec 2013 14:45:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EED28207C6 for ; Thu, 12 Dec 2013 14:45:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4477E20624 for ; Thu, 12 Dec 2013 14:45:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25360FB55C; Thu, 12 Dec 2013 06:45:23 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f43.google.com (mail-bk0-f43.google.com [209.85.214.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CE63FB55C for ; Thu, 12 Dec 2013 06:45:20 -0800 (PST) Received: by mail-bk0-f43.google.com with SMTP id mz12so903696bkb.2 for ; Thu, 12 Dec 2013 06:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=xoU93KgFXpqhBWAo/ttcklErhI6jKJ2CC2jYiQ4ezmA=; b=PiiEdMpe7MS7Ijp8vQJgRcXECa8+OMx3DH2zojlXEYX4eZB1VKfj1kGOzC/VEgMBpV E0qnBo2DUAigIbxqcyv3Q2TWB5VTz5FaZKSQVVbJe/t9XxRF/VmgsW0YNMCy3xbKGwiC 5/6C0A1HA1nGU6m1W1zMkkAxqJVF8cUQ3hD5BBXImMluovrWVXjV7yJesuWS5iTIpE1c RBL1tDvC0qfKWphiTH+ClirbDb1YcIvn42j0t3jdMsflqL3upWXvlIm/0IFC3hvd+SFO ypd1VgKmYQ6ve2mZbX5OfjbTBOOq8Q3jVktezkiNQOk+e5PWS0KBdtL4VTwPk5Qdnnf8 6AuQ== X-Received: by 10.204.233.73 with SMTP id jx9mr483080bkb.100.1386859518645; Thu, 12 Dec 2013 06:45:18 -0800 (PST) Received: from localhost (port-31954.pppoe.wtnet.de. [46.59.175.170]) by mx.google.com with ESMTPSA id l5sm18550336bko.7.2013.12.12.06.45.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2013 06:45:17 -0800 (PST) From: Thierry Reding To: David Airlie Subject: [PATCH] drm: Implement dummies for debugfs helpers Date: Thu, 12 Dec 2013 15:44:04 +0100 Message-Id: <1386859444-1693-1-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4.2 Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case where debugfs support is disabled, define dummy functions to avoid the need for #ifdefery in drivers. Based on an earlier patch by Arnd Bergmann. Signed-off-by: Thierry Reding --- include/drm/drmP.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 1d4a920ef7ff..28beb385380c 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1461,6 +1461,30 @@ extern int drm_debugfs_create_files(const struct drm_info_list *files, extern int drm_debugfs_remove_files(const struct drm_info_list *files, int count, struct drm_minor *minor); extern int drm_debugfs_cleanup(struct drm_minor *minor); +#else +static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id, + struct dentry *root) +{ + return 0; +} + +static inline int drm_debugfs_create_files(const struct drm_info_list *files, + int count, struct dentry *root, + struct drm_minor *minor) +{ + return 0; +} + +static inline int drm_debugfs_remove_files(const struct drm_info_list *files, + int count, struct drm_minor *minor) +{ + return 0; +} + +static inline int drm_debugfs_cleanup(struct drm_minor *minor) +{ + return 0; +} #endif /* Info file support */