History

PM / Domains: Enable genpd_dev_pm_attach_by_id|name() for single PM domain

If a call to dev_pm_domain_attach() succeeds to attach a device to its single PM domain, the important point is to prevent subsequent dev_pm_domain_attach_by_name|id() calls from failing. That is done by checking the dev->pm_domain pointer and then returning -EEXIST, rather than continuing to call genpd_dev_pm_attach_by_id|name(). For this reason, enable genpd_dev_pm_attach_by_id|name() to be used for single PM domains too. This simplifies future users, so they only need to use dev_pm_domain_attach_by_id|name() instead of having to combine it with dev_pm_domain_attach().

Ulf Hansson committed 7 years ago

Commit 3ccf3f01 parent e8b04de1 file · +2 −2Browse files

Unified · Split

drivers/base/power/domain.c+2−2
@@ -2439,10 +2439,10 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, · 2438 unmodified lines
24392439 if (!dev->of_node)
24402440 return NULL;
24412441
2442− /* Deal only with devices using multiple PM domains. */
2442+ /* Verify that the index is within a valid range. */
24432443 num_domains = of_count_phandle_with_args(dev->of_node, "power-domains",
24442444 "#power-domain-cells");
2445− if (num_domains < 2 || index >= num_domains)
2445+ if (index >= num_domains)
24462446 return NULL;
24472447
24482448 /* Allocate and register device on the genpd bus. */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t