Skip to content

Commit 3ee4082

Browse files
claudiubezneaUlf Hansson
authored andcommitted
amba: bus: Drop dev_pm_domain_detach() call
Starting with commit f995080 ("PM: domains: Detach on device_unbind_cleanup()"), there is no longer a need to call dev_pm_domain_detach() in the bus remove function. The device_unbind_cleanup() function now handles this to avoid invoking devres cleanup handlers while the PM domain is powered off, which could otherwise lead to failures as described in the above-mentioned commit. Drop the explicit dev_pm_domain_detach() call and rely instead on the flags passed to dev_pm_domain_attach() to power off the domain. Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent d4aa596 commit 3ee4082

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/amba/bus.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,14 @@ static int amba_probe(struct device *dev)
291291
if (ret < 0)
292292
break;
293293

294-
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON);
294+
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON |
295+
PD_FLAG_DETACH_POWER_OFF);
295296
if (ret)
296297
break;
297298

298299
ret = amba_get_enable_pclk(pcdev);
299-
if (ret) {
300-
dev_pm_domain_detach(dev, true);
300+
if (ret)
301301
break;
302-
}
303302

304303
pm_runtime_get_noresume(dev);
305304
pm_runtime_set_active(dev);
@@ -314,7 +313,6 @@ static int amba_probe(struct device *dev)
314313
pm_runtime_put_noidle(dev);
315314

316315
amba_put_disable_pclk(pcdev);
317-
dev_pm_domain_detach(dev, true);
318316
} while (0);
319317

320318
return ret;
@@ -336,7 +334,6 @@ static void amba_remove(struct device *dev)
336334
pm_runtime_put_noidle(dev);
337335

338336
amba_put_disable_pclk(pcdev);
339-
dev_pm_domain_detach(dev, true);
340337
}
341338

342339
static void amba_shutdown(struct device *dev)

0 commit comments

Comments
 (0)