Loading drivers/regulator/core.c +20 −8 Original line number Diff line number Diff line Loading @@ -3944,6 +3944,14 @@ static const struct file_operations reg_consumers_fops = { .release = single_release, }; static void rdev_deinit_debugfs(struct regulator_dev *rdev) { if (!IS_ERR_OR_NULL(rdev)) { debugfs_remove_recursive(rdev->debugfs); regulator_put(rdev->debug_consumer); } } static void rdev_init_debugfs(struct regulator_dev *rdev) { struct dentry *err_ptr = NULL; Loading Loading @@ -3978,6 +3986,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) pr_err("Error-Bad Function Input\n"); goto error; } rdev->debug_consumer = reg; rdev->open_offset = 1; reg_ops = rdev->desc->ops; Loading @@ -3988,7 +3997,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) reg, ®_enable_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create enable file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4003,7 +4011,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) ®_bypass_enable_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create bypass enable file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4018,7 +4025,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) rdev->debugfs, reg, ®_fdisable_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create force_disable file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4033,7 +4039,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) reg, ®_volt_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create voltage file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4048,7 +4053,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) reg, ®_mode_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create mode file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4063,18 +4067,26 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) rdev->debugfs, reg, ®_optimum_mode_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create optimum_mode file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } return; error: rdev_deinit_debugfs(rdev); return; } #else static inline void rdev_deinit_debugfs(struct regulator_dev *rdev) { } static inline void rdev_init_debugfs(struct regulator_dev *rdev) { return; } #endif /** Loading Loading @@ -4290,8 +4302,8 @@ void regulator_unregister(struct regulator_dev *rdev) regulator_put(rdev->supply); } regulator_proxy_consumer_unregister(rdev->proxy_consumer); rdev_deinit_debugfs(rdev); mutex_lock(®ulator_list_mutex); debugfs_remove_recursive(rdev->debugfs); flush_work(&rdev->disable_work.work); WARN_ON(rdev->open_count); unset_regulator_supplies(rdev); Loading include/linux/regulator/driver.h +1 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,7 @@ struct regulator_dev { /* time when this regulator was disabled last time */ unsigned long last_off_jiffy; struct proxy_consumer *proxy_consumer; struct regulator *debug_consumer; }; struct regulator_dev * Loading Loading
drivers/regulator/core.c +20 −8 Original line number Diff line number Diff line Loading @@ -3944,6 +3944,14 @@ static const struct file_operations reg_consumers_fops = { .release = single_release, }; static void rdev_deinit_debugfs(struct regulator_dev *rdev) { if (!IS_ERR_OR_NULL(rdev)) { debugfs_remove_recursive(rdev->debugfs); regulator_put(rdev->debug_consumer); } } static void rdev_init_debugfs(struct regulator_dev *rdev) { struct dentry *err_ptr = NULL; Loading Loading @@ -3978,6 +3986,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) pr_err("Error-Bad Function Input\n"); goto error; } rdev->debug_consumer = reg; rdev->open_offset = 1; reg_ops = rdev->desc->ops; Loading @@ -3988,7 +3997,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) reg, ®_enable_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create enable file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4003,7 +4011,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) ®_bypass_enable_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create bypass enable file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4018,7 +4025,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) rdev->debugfs, reg, ®_fdisable_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create force_disable file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4033,7 +4039,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) reg, ®_volt_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create voltage file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4048,7 +4053,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) reg, ®_mode_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create mode file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } Loading @@ -4063,18 +4067,26 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) rdev->debugfs, reg, ®_optimum_mode_fops); if (IS_ERR(err_ptr)) { pr_err("Error-Could not create optimum_mode file\n"); debugfs_remove_recursive(rdev->debugfs); goto error; } return; error: rdev_deinit_debugfs(rdev); return; } #else static inline void rdev_deinit_debugfs(struct regulator_dev *rdev) { } static inline void rdev_init_debugfs(struct regulator_dev *rdev) { return; } #endif /** Loading Loading @@ -4290,8 +4302,8 @@ void regulator_unregister(struct regulator_dev *rdev) regulator_put(rdev->supply); } regulator_proxy_consumer_unregister(rdev->proxy_consumer); rdev_deinit_debugfs(rdev); mutex_lock(®ulator_list_mutex); debugfs_remove_recursive(rdev->debugfs); flush_work(&rdev->disable_work.work); WARN_ON(rdev->open_count); unset_regulator_supplies(rdev); Loading
include/linux/regulator/driver.h +1 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,7 @@ struct regulator_dev { /* time when this regulator was disabled last time */ unsigned long last_off_jiffy; struct proxy_consumer *proxy_consumer; struct regulator *debug_consumer; }; struct regulator_dev * Loading