Skip to contentSkip to conversation

drivers/block/mtip32xx: Fix incorrect warning

PATCH RESEND In review Daniel Cotton 2 participants 3 messages Oct 12, 2014 – Oct 17, 2014 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drivers/block/mtip32xx: Fix incorrect warning

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.

---
 drivers/block/mtip32xx/mtip32xx.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +7 -4
index 5c8e7fe..1124c61 100644
@@ -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;
 		}
 	}
#1 lore raw
Quoted 4 lines · Daniel Cotton

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.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 3 lines · Jens Axboe

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.

---
 drivers/block/mtip32xx/mtip32xx.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +7 -4
index 936f8c1..b0953e3 100644
@@ -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;
 		}
 	}