From patchwork Thu Jul 23 14:06:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6853861 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5B9E09F38B for ; Thu, 23 Jul 2015 14:06:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 621392077D for ; Thu, 23 Jul 2015 14:06:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 90D5B2066E for ; Thu, 23 Jul 2015 14:06:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D9F96EC97; Thu, 23 Jul 2015 07:06:24 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1458A6E3E8; Thu, 23 Jul 2015 07:06:23 -0700 (PDT) Received: by padck2 with SMTP id ck2so157666477pad.0; Thu, 23 Jul 2015 07:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=J/3c4OMEaeqRGqzCrqF22EsO2xFaBN6iUATalsYZKok=; b=EOLo+IgFuPjBoRDjIbGffa13XhGLtlxDSaOq1wMVTjOLcGjhGv0RmK/h0ZclHYY67l yrgSWfbzU3zHG9O8rROs0uYa+i/eapuAqLD16CIaJOUy2SQFAbPoL+2o9hE+0mW7Oa8B sJyFTS1mE5d8dDY/Xd3wRvI2Ng4yKDeDx5K49/GxgC+m4ncaLw2PgKBfB3arE5qOWqCq mcs0LBMjHPo0JRn46VU/YpJQfm+QKelKuk3Di5Pyj279Ig5PaW4poLmXcAIfiiV5xbJ0 zU7qLDhyLnUPIYM4TSA5X1UpAwJ3I5pAbmomnpo0/GNLLj+g45DzoGDFIDNeryo9/Eg7 vmTQ== X-Received: by 10.66.159.1 with SMTP id wy1mr19326192pab.103.1437660382661; Thu, 23 Jul 2015 07:06:22 -0700 (PDT) Received: from localhost.localdomain ([49.206.252.123]) by smtp.gmail.com with ESMTPSA id ns14sm9282479pdb.17.2015.07.23.07.06.19 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jul 2015 07:06:21 -0700 (PDT) From: Sudip Mukherjee To: Daniel Vetter , Jani Nikula , David Airlie Subject: [PATCH v2] drm/i915: load driver even if debugfs fails Date: Thu, 23 Jul 2015 19:36:12 +0530 Message-Id: <1437660372-14679-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sudip Mukherjee X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.3 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 debugfs files are not necessary for the usual operation of the driver and the device. No need to check for the return values from the debugfs file creation. Even if one debugfs file fails to create we try with the next debugfs file and ultimately return success always so that the driver continues to load. cleanup will clean all the created debugfs files as the list of file that are created are maintained in minor->debugfs_list. Cc: Chris Wilson Signed-off-by: Sudip Mukherjee --- v1 was drm/i915: add error path drivers/gpu/drm/i915/i915_debugfs.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index caf1382..8b1a42a 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -5138,29 +5138,22 @@ void intel_display_crc_init(struct drm_device *dev) int i915_debugfs_init(struct drm_minor *minor) { - int ret, i; + int i; - ret = i915_forcewake_create(minor->debugfs_root, minor); - if (ret) - return ret; + i915_forcewake_create(minor->debugfs_root, minor); - for (i = 0; i < ARRAY_SIZE(i915_pipe_crc_data); i++) { - ret = i915_pipe_crc_create(minor->debugfs_root, minor, i); - if (ret) - return ret; - } + for (i = 0; i < ARRAY_SIZE(i915_pipe_crc_data); i++) + i915_pipe_crc_create(minor->debugfs_root, minor, i); - for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) { - ret = i915_debugfs_create(minor->debugfs_root, minor, - i915_debugfs_files[i].name, - i915_debugfs_files[i].fops); - if (ret) - return ret; - } + for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) + i915_debugfs_create(minor->debugfs_root, minor, + i915_debugfs_files[i].name, + i915_debugfs_files[i].fops); + + drm_debugfs_create_files(i915_debugfs_list, I915_DEBUGFS_ENTRIES, + minor->debugfs_root, minor); - return drm_debugfs_create_files(i915_debugfs_list, - I915_DEBUGFS_ENTRIES, - minor->debugfs_root, minor); + return 0; } void i915_debugfs_cleanup(struct drm_minor *minor)