diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 94fe30c187ad..24a82e252b7e 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -217,13 +217,10 @@ static void genpd_debug_add(struct generic_pm_domain *genpd); static void genpd_debug_remove(struct generic_pm_domain *genpd) { - struct dentry *d; - if (!genpd_debugfs_dir) return; - d = debugfs_lookup(genpd->name, genpd_debugfs_dir); - debugfs_remove(d); + debugfs_lookup_and_remove(genpd->name, genpd_debugfs_dir); } static void genpd_update_accounting(struct generic_pm_domain *genpd)