Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: core: Fix error checking and messages

Merge series from Geert Uytterhoeven <geert+renesas@glider.be>:

This patch series corrects an error check, fixes error messages when
debugfs is not enabled, and improves debugfs error handling in the
regulator core.

+13 -17
+13 -17
drivers/regulator/core.c
··· 1911 1911 1912 1912 if (err != -EEXIST) 1913 1913 regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs); 1914 - if (!regulator->debugfs) { 1914 + if (IS_ERR(regulator->debugfs)) 1915 1915 rdev_dbg(rdev, "Failed to create debugfs directory\n"); 1916 - } else { 1917 - debugfs_create_u32("uA_load", 0444, regulator->debugfs, 1918 - &regulator->uA_load); 1919 - debugfs_create_u32("min_uV", 0444, regulator->debugfs, 1920 - &regulator->voltage[PM_SUSPEND_ON].min_uV); 1921 - debugfs_create_u32("max_uV", 0444, regulator->debugfs, 1922 - &regulator->voltage[PM_SUSPEND_ON].max_uV); 1923 - debugfs_create_file("constraint_flags", 0444, 1924 - regulator->debugfs, regulator, 1925 - &constraint_flags_fops); 1926 - } 1916 + 1917 + debugfs_create_u32("uA_load", 0444, regulator->debugfs, 1918 + &regulator->uA_load); 1919 + debugfs_create_u32("min_uV", 0444, regulator->debugfs, 1920 + &regulator->voltage[PM_SUSPEND_ON].min_uV); 1921 + debugfs_create_u32("max_uV", 0444, regulator->debugfs, 1922 + &regulator->voltage[PM_SUSPEND_ON].max_uV); 1923 + debugfs_create_file("constraint_flags", 0444, regulator->debugfs, 1924 + regulator, &constraint_flags_fops); 1927 1925 1928 1926 /* 1929 1927 * Check now if the regulator is an always on regulator - if ··· 5254 5256 } 5255 5257 5256 5258 rdev->debugfs = debugfs_create_dir(rname, debugfs_root); 5257 - if (IS_ERR(rdev->debugfs)) { 5258 - rdev_warn(rdev, "Failed to create debugfs directory\n"); 5259 - return; 5260 - } 5259 + if (IS_ERR(rdev->debugfs)) 5260 + rdev_dbg(rdev, "Failed to create debugfs directory\n"); 5261 5261 5262 5262 debugfs_create_u32("use_count", 0444, rdev->debugfs, 5263 5263 &rdev->use_count); ··· 6175 6179 6176 6180 debugfs_root = debugfs_create_dir("regulator", NULL); 6177 6181 if (IS_ERR(debugfs_root)) 6178 - pr_warn("regulator: Failed to create debugfs directory\n"); 6182 + pr_debug("regulator: Failed to create debugfs directory\n"); 6179 6183 6180 6184 #ifdef CONFIG_DEBUG_FS 6181 6185 debugfs_create_file("supply_map", 0444, debugfs_root, NULL,