diff options
| -rw-r--r-- | drivers/base/power/domain.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 6f403d6fccb2..908c44779ae7 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -2229,10 +2229,10 @@ static void genpd_dev_pm_sync(struct device *dev) | |||
| 2229 | * attaches the device to retrieved pm_domain ops. | 2229 | * attaches the device to retrieved pm_domain ops. |
| 2230 | * | 2230 | * |
| 2231 | * Returns 1 on successfully attached PM domain, 0 when the device don't need a | 2231 | * Returns 1 on successfully attached PM domain, 0 when the device don't need a |
| 2232 | * PM domain or a negative error code in case of failures. Note that if a | 2232 | * PM domain or when multiple power-domains exists for it, else a negative error |
| 2233 | * power-domain exists for the device, but it cannot be found or turned on, | 2233 | * code. Note that if a power-domain exists for the device, but it cannot be |
| 2234 | * then return -EPROBE_DEFER to ensure that the device is not probed and to | 2234 | * found or turned on, then return -EPROBE_DEFER to ensure that the device is |
| 2235 | * re-try again later. | 2235 | * not probed and to re-try again later. |
| 2236 | */ | 2236 | */ |
| 2237 | int genpd_dev_pm_attach(struct device *dev) | 2237 | int genpd_dev_pm_attach(struct device *dev) |
| 2238 | { | 2238 | { |
| @@ -2243,10 +2243,18 @@ int genpd_dev_pm_attach(struct device *dev) | |||
| 2243 | if (!dev->of_node) | 2243 | if (!dev->of_node) |
| 2244 | return 0; | 2244 | return 0; |
| 2245 | 2245 | ||
| 2246 | /* | ||
| 2247 | * Devices with multiple PM domains must be attached separately, as we | ||
| 2248 | * can only attach one PM domain per device. | ||
| 2249 | */ | ||
| 2250 | if (of_count_phandle_with_args(dev->of_node, "power-domains", | ||
| 2251 | "#power-domain-cells") != 1) | ||
| 2252 | return 0; | ||
| 2253 | |||
| 2246 | ret = of_parse_phandle_with_args(dev->of_node, "power-domains", | 2254 | ret = of_parse_phandle_with_args(dev->of_node, "power-domains", |
| 2247 | "#power-domain-cells", 0, &pd_args); | 2255 | "#power-domain-cells", 0, &pd_args); |
| 2248 | if (ret < 0) | 2256 | if (ret < 0) |
| 2249 | return 0; | 2257 | return ret; |
| 2250 | 2258 | ||
| 2251 | mutex_lock(&gpd_list_lock); | 2259 | mutex_lock(&gpd_list_lock); |
| 2252 | pd = genpd_get_from_provider(&pd_args); | 2260 | pd = genpd_get_from_provider(&pd_args); |
