diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2018-05-29 06:04:15 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-05-30 07:51:51 -0400 |
commit | 924f448699627722a7dcaefb857d09fd324e75c5 (patch) | |
tree | d71826e918b6182ee810fed76f951da88cb0faef | |
parent | 1a7a67072f35b3e65e76fc694b088ca48b4dae35 (diff) |
PM / Domains: Drop genpd as in-param for pm_genpd_remove_device()
There is no need to pass a genpd struct to pm_genpd_remove_device(), as we
already have the information about the PM domain (genpd) through the device
structure.
Additionally, we don't allow to remove a PM domain from a device, other
than the one it may have assigned to it, so really it does not make sense
to have a separate in-param for it.
For these reason, drop it and update the current only call to
pm_genpd_remove_device() from amdgpu_acp.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/base/power/domain.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 | ||||
-rw-r--r-- | include/linux/pm_domain.h | 5 |
3 files changed, 7 insertions, 8 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 2bb67e4f6280..83ce6ca6c769 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -1475,13 +1475,13 @@ static int genpd_remove_device(struct generic_pm_domain *genpd, | |||
1475 | 1475 | ||
1476 | /** | 1476 | /** |
1477 | * pm_genpd_remove_device - Remove a device from an I/O PM domain. | 1477 | * pm_genpd_remove_device - Remove a device from an I/O PM domain. |
1478 | * @genpd: PM domain to remove the device from. | ||
1479 | * @dev: Device to be removed. | 1478 | * @dev: Device to be removed. |
1480 | */ | 1479 | */ |
1481 | int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 1480 | int pm_genpd_remove_device(struct device *dev) |
1482 | struct device *dev) | ||
1483 | { | 1481 | { |
1484 | if (!genpd || genpd != genpd_lookup_dev(dev)) | 1482 | struct generic_pm_domain *genpd = genpd_lookup_dev(dev); |
1483 | |||
1484 | if (!genpd) | ||
1485 | return -EINVAL; | 1485 | return -EINVAL; |
1486 | 1486 | ||
1487 | return genpd_remove_device(genpd, dev); | 1487 | return genpd_remove_device(genpd, dev); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index a29362f9ef41..12558044acd4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | |||
@@ -513,7 +513,7 @@ static int acp_hw_fini(void *handle) | |||
513 | if (adev->acp.acp_genpd) { | 513 | if (adev->acp.acp_genpd) { |
514 | for (i = 0; i < ACP_DEVS ; i++) { | 514 | for (i = 0; i < ACP_DEVS ; i++) { |
515 | dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); | 515 | dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); |
516 | ret = pm_genpd_remove_device(&adev->acp.acp_genpd->gpd, dev); | 516 | ret = pm_genpd_remove_device(dev); |
517 | /* If removal fails, dont giveup and try rest */ | 517 | /* If removal fails, dont giveup and try rest */ |
518 | if (ret) | 518 | if (ret) |
519 | dev_err(dev, "remove dev from genpd failed\n"); | 519 | dev_err(dev, "remove dev from genpd failed\n"); |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 79888fb4a81f..42e0d649e653 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -144,7 +144,7 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev); | 146 | int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev); |
147 | int pm_genpd_remove_device(struct generic_pm_domain *genpd, struct device *dev); | 147 | int pm_genpd_remove_device(struct device *dev); |
148 | int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 148 | int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
149 | struct generic_pm_domain *new_subdomain); | 149 | struct generic_pm_domain *new_subdomain); |
150 | int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 150 | int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, |
@@ -167,8 +167,7 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | |||
167 | { | 167 | { |
168 | return -ENOSYS; | 168 | return -ENOSYS; |
169 | } | 169 | } |
170 | static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 170 | static inline int pm_genpd_remove_device(struct device *dev) |
171 | struct device *dev) | ||
172 | { | 171 | { |
173 | return -ENOSYS; | 172 | return -ENOSYS; |
174 | } | 173 | } |