linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] drivers/block/mtip32xx: Fix incorrect warning
@ 2014-10-12 11:55 Daniel Cotton
  2014-10-13 14:41 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Cotton @ 2014-10-12 11:55 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel

Prevent mtip32xx block driver from showing a warning at load time 
("Error creating debugfs parent") when debugfs is not included in
the kernel. If debugfs is included, show the error code. Fixes bug
55831 in the Bugzilla.

Signed-off-by: Daniel Cotton <danielcotton.patches@gmail.com>
---
  drivers/block/mtip32xx/mtip32xx.c | 11 +++++++----
  1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c 
b/drivers/block/mtip32xx/mtip32xx.c
index 5c8e7fe..1124c61 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -4686,16 +4686,19 @@ static int __init mtip_init(void)
  	mtip_major = error;

  	dfs_parent = debugfs_create_dir("rssd", NULL);
-	if (IS_ERR_OR_NULL(dfs_parent)) {
-		pr_warn("Error creating debugfs parent\n");
+	if (IS_ERR_OR_NULL(dfs_parent) && PTR_ERR(dfs_parent) != -ENODEV) {
+		pr_warn("Error creating debugfs parent, error code: %ld\n",
+			PTR_ERR(dfs_parent));
  		dfs_parent = NULL;
  	}
  	if (dfs_parent) {
  		dfs_device_status = debugfs_create_file("device_status",
  					S_IRUGO, dfs_parent, NULL,
  					&mtip_device_status_fops);
-		if (IS_ERR_OR_NULL(dfs_device_status)) {
-			pr_err("Error creating device_status node\n");
+		if (IS_ERR_OR_NULL(dfs_device_status) &&
+		    PTR_ERR(dfs_device_status) != -ENODEV) {
+			pr_err("Error creating device_status node, error code: %ld\n",
+				PTR_ERR(dfs_device_status));
  			dfs_device_status = NULL;
  		}
  	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] drivers/block/mtip32xx: Fix incorrect warning
  2014-10-12 11:55 [PATCH RESEND] drivers/block/mtip32xx: Fix incorrect warning Daniel Cotton
@ 2014-10-13 14:41 ` Jens Axboe
  2014-10-17 16:45   ` Daniel Cotton
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2014-10-13 14:41 UTC (permalink / raw)
  To: Daniel Cotton; +Cc: linux-kernel

On 2014-10-12 05:55, Daniel Cotton wrote:
> Prevent mtip32xx block driver from showing a warning at load time
> ("Error creating debugfs parent") when debugfs is not included in
> the kernel. If debugfs is included, show the error code. Fixes bug
> 55831 in the Bugzilla.

What is the patch against? It doesn't apply to for-3.18/drivers or even 
master.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] drivers/block/mtip32xx: Fix incorrect warning
  2014-10-13 14:41 ` Jens Axboe
@ 2014-10-17 16:45   ` Daniel Cotton
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Cotton @ 2014-10-17 16:45 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

On 14/10/2014 1:11 am, Jens Axboe wrote:
 > What is the patch against? It doesn't apply to for-3.18/drivers or even
 > master.
 >

Sorry about that, I'm new to this; it applied against whatever master I 
had at the time. Here's a v2 against for-3.18/drivers:

Prevent mtip32xx block driver from showing a warning at load time 
("Error creating debugfs parent") when debugfs is not included in
the kernel. If debugfs is included, show the error code. Fixes bug
55831 in the Bugzilla.

Signed-off-by: Daniel Cotton <danielcotton.patches@gmail.com>
---
  drivers/block/mtip32xx/mtip32xx.c | 11 +++++++----
  1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c 
b/drivers/block/mtip32xx/mtip32xx.c
index 936f8c1..b0953e3 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -4688,16 +4688,19 @@ static int __init mtip_init(void)
  	mtip_major = error;

  	dfs_parent = debugfs_create_dir("rssd", NULL);
-	if (IS_ERR_OR_NULL(dfs_parent)) {
-		pr_warn("Error creating debugfs parent\n");
+	if (IS_ERR_OR_NULL(dfs_parent) && PTR_ERR(dfs_parent) != -ENODEV) {
+		pr_warn("Error creating debugfs parent, error code: %ld\n",
+			PTR_ERR(dfs_parent));
  		dfs_parent = NULL;
  	}
  	if (dfs_parent) {
  		dfs_device_status = debugfs_create_file("device_status",
  					S_IRUGO, dfs_parent, NULL,
  					&mtip_device_status_fops);
-		if (IS_ERR_OR_NULL(dfs_device_status)) {
-			pr_err("Error creating device_status node\n");
+		if (IS_ERR_OR_NULL(dfs_device_status) &&
+		    PTR_ERR(dfs_device_status) != -ENODEV) {
+			pr_err("Error creating device_status node, error code: %ld\n",
+				PTR_ERR(dfs_device_status));
  			dfs_device_status = NULL;
  		}
  	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-17 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-12 11:55 [PATCH RESEND] drivers/block/mtip32xx: Fix incorrect warning Daniel Cotton
2014-10-13 14:41 ` Jens Axboe
2014-10-17 16:45   ` Daniel Cotton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).