diff mbox

omap2plus: smartreflex: add error checking for debugfs_create_*()

Message ID 1296129136-11116-1-git-send-email-sawant@ti.com (mailing list archive)
State Superseded
Delegated to: Kevin Hilman
Headers show

Commit Message

Anand Sawant Jan. 27, 2011, 11:52 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 77ecebf..c57f80f 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -822,7 +822,7 @@  static int __init omap_sr_probe(struct platform_device *pdev)
 	struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
 	struct omap_sr_data *pdata = pdev->dev.platform_data;
 	struct resource *mem, *irq;
-	struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
+	struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir, *dbg_entry;
 	struct omap_volt_data *volt_data;
 	int i, ret = 0;
 
@@ -901,14 +901,37 @@  static int __init omap_sr_probe(struct platform_device *pdev)
 		return PTR_ERR(dbg_dir);
 	}
 
-	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
+	dbg_entry = debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
 				(void *)sr_info, &pm_sr_fops);
-	(void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
+	if (IS_ERR(dbg_entry)) {
+		dev_warn(&pdev->dev,
+			"%s: Unable to create debugfs entry for autocomp",
+			__func__);
+	}
+
+	dbg_entry = debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
 			&sr_info->err_weight);
-	(void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
+	if (IS_ERR(dbg_entry)) {
+		dev_warn(&pdev->dev,
+			"%s: Unable to create debugfs entry for errweight",
+			__func__);
+	}
+
+	dbg_entry = debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
 			&sr_info->err_maxlimit);
-	(void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
+	if (IS_ERR(dbg_entry)) {
+		dev_warn(&pdev->dev,
+			"%s: Unable to create debugfs entry for errmaxlimit",
+			__func__);
+	}
+
+	dbg_entry = debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
 			&sr_info->err_minlimit);
+	if (IS_ERR(dbg_entry)) {
+		dev_warn(&pdev->dev,
+			"%s: Unable to create debugfs entry for errminlimit",
+			__func__);
+	}
 
 	nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
 	if (IS_ERR(nvalue_dir)) {
@@ -940,8 +963,14 @@  static int __init omap_sr_probe(struct platform_device *pdev)
 		strcpy(name, "volt_");
 		sprintf(volt_name, "%d", volt_data[i].volt_nominal);
 		strcat(name, volt_name);
-		(void) debugfs_create_x32(name, S_IRUGO | S_IWUGO, nvalue_dir,
+		dbg_entry = debugfs_create_x32(name, S_IRUGO | S_IWUGO,
+				nvalue_dir,
 				&(sr_info->nvalue_table[i].nvalue));
+		if (IS_ERR(dbg_entry)) {
+			dev_warn(&pdev->dev,
+				"%s: Unable to create debugfs entry for %s",
+				__func__, name);
+		}
 	}
 
 	return ret;