mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	David Airlie <airlied@linux.ie>
Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Subject: [PATCH v2] drm/i915: load driver even if debugfs fails
Date: Thu, 23 Jul 2015 19:36:12 +0530	[thread overview]
Message-ID: <1437660372-14679-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)

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 <chris@chris-wilson.co.uk>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

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


             reply	other threads:[~2015-07-23 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 14:06 Sudip Mukherjee [this message]
2015-08-03  9:26 ` Sudip Mukherjee
2015-08-03 10:54   ` Daniel Vetter
2015-08-03 11:45     ` Sudip Mukherjee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437660372-14679-1-git-send-email-sudipm.mukherjee@gmail.com \
    --to=sudipm.mukherjee@gmail.com \
    --cc=airlied@linux.ie \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®