Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256AbbGWOGc (ORCPT ); Thu, 23 Jul 2015 10:06:32 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34550 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbbGWOGX (ORCPT ); Thu, 23 Jul 2015 10:06:23 -0400 From: Sudip Mukherjee To: Daniel Vetter , Jani Nikula , David Airlie Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Sudip Mukherjee , Chris Wilson 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2405 Lines: 71 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) -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/