aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-20 16:01:04 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-21 04:56:38 -0500
commitf4d562c6e616bb686f43d38752b2e5b83359e1fc (patch)
treea453c82c9429cedc8ed87673dd145cba9f45fa68
parentb29c7690a764b9829b1034f873f97b7bbfa19565 (diff)
regulator: Clean up debugfs error handling a bit
Use IS_ERR_OR_NULL() rather than open coding it and ignore errors from failure to create the supply map. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/regulator/core.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6c845200a530..81ea66dcca9c 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2712,7 +2712,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
2712{ 2712{
2713#ifdef CONFIG_DEBUG_FS 2713#ifdef CONFIG_DEBUG_FS
2714 rdev->debugfs = debugfs_create_dir(rdev_get_name(rdev), debugfs_root); 2714 rdev->debugfs = debugfs_create_dir(rdev_get_name(rdev), debugfs_root);
2715 if (IS_ERR(rdev->debugfs) || !rdev->debugfs) { 2715 if (IS_ERR_OR_NULL(rdev->debugfs)) {
2716 rdev_warn(rdev, "Failed to create debugfs directory\n"); 2716 rdev_warn(rdev, "Failed to create debugfs directory\n");
2717 rdev->debugfs = NULL; 2717 rdev->debugfs = NULL;
2718 return; 2718 return;
@@ -3127,14 +3127,13 @@ static int __init regulator_init(void)
3127 3127
3128#ifdef CONFIG_DEBUG_FS 3128#ifdef CONFIG_DEBUG_FS
3129 debugfs_root = debugfs_create_dir("regulator", NULL); 3129 debugfs_root = debugfs_create_dir("regulator", NULL);
3130 if (IS_ERR(debugfs_root) || !debugfs_root) { 3130 if (IS_ERR_OR_NULL(debugfs_root)) {
3131 pr_warn("regulator: Failed to create debugfs directory\n"); 3131 pr_warn("regulator: Failed to create debugfs directory\n");
3132 debugfs_root = NULL; 3132 debugfs_root = NULL;
3133 } 3133 }
3134 3134
3135 if (IS_ERR(debugfs_create_file("supply_map", 0444, debugfs_root, 3135 debugfs_create_file("supply_map", 0444, debugfs_root, NULL,
3136 NULL, &supply_map_fops))) 3136 &supply_map_fops);
3137 pr_warn("regulator: Failed to create supplies debugfs\n");
3138#endif 3137#endif
3139 3138
3140 regulator_dummy_init(); 3139 regulator_dummy_init();