diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-09-03 06:52:17 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-08 18:46:11 -0400 |
commit | 55e15c949fd05d247a889df0ed0177a676fec665 (patch) | |
tree | 238fbac6120af1cc9d99081dc3f1d6537cc68e08 /drivers/base | |
parent | 2ce7598c9a453e0acd0e07be7be3f5eb39608ebd (diff) |
PM / domains: Remove the pm_genpd_add|remove_callbacks APIs
There are no users of these APIs. To simplify the generic power domain
let's remove them.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/domain.c | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index eee55c1e5fde..e613e3cb96d8 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -1744,112 +1744,6 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | |||
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | /** | 1746 | /** |
1747 | * pm_genpd_add_callbacks - Add PM domain callbacks to a given device. | ||
1748 | * @dev: Device to add the callbacks to. | ||
1749 | * @ops: Set of callbacks to add. | ||
1750 | * @td: Timing data to add to the device along with the callbacks (optional). | ||
1751 | * | ||
1752 | * Every call to this routine should be balanced with a call to | ||
1753 | * __pm_genpd_remove_callbacks() and they must not be nested. | ||
1754 | */ | ||
1755 | int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops, | ||
1756 | struct gpd_timing_data *td) | ||
1757 | { | ||
1758 | struct generic_pm_domain_data *gpd_data_new, *gpd_data = NULL; | ||
1759 | int ret = 0; | ||
1760 | |||
1761 | if (!(dev && ops)) | ||
1762 | return -EINVAL; | ||
1763 | |||
1764 | gpd_data_new = __pm_genpd_alloc_dev_data(dev); | ||
1765 | if (!gpd_data_new) | ||
1766 | return -ENOMEM; | ||
1767 | |||
1768 | pm_runtime_disable(dev); | ||
1769 | device_pm_lock(); | ||
1770 | |||
1771 | ret = dev_pm_get_subsys_data(dev); | ||
1772 | if (ret) | ||
1773 | goto out; | ||
1774 | |||
1775 | spin_lock_irq(&dev->power.lock); | ||
1776 | |||
1777 | if (dev->power.subsys_data->domain_data) { | ||
1778 | gpd_data = to_gpd_data(dev->power.subsys_data->domain_data); | ||
1779 | } else { | ||
1780 | gpd_data = gpd_data_new; | ||
1781 | dev->power.subsys_data->domain_data = &gpd_data->base; | ||
1782 | } | ||
1783 | gpd_data->refcount++; | ||
1784 | gpd_data->ops = *ops; | ||
1785 | if (td) | ||
1786 | gpd_data->td = *td; | ||
1787 | |||
1788 | spin_unlock_irq(&dev->power.lock); | ||
1789 | |||
1790 | out: | ||
1791 | device_pm_unlock(); | ||
1792 | pm_runtime_enable(dev); | ||
1793 | |||
1794 | if (gpd_data != gpd_data_new) | ||
1795 | __pm_genpd_free_dev_data(dev, gpd_data_new); | ||
1796 | |||
1797 | return ret; | ||
1798 | } | ||
1799 | EXPORT_SYMBOL_GPL(pm_genpd_add_callbacks); | ||
1800 | |||
1801 | /** | ||
1802 | * __pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device. | ||
1803 | * @dev: Device to remove the callbacks from. | ||
1804 | * @clear_td: If set, clear the device's timing data too. | ||
1805 | * | ||
1806 | * This routine can only be called after pm_genpd_add_callbacks(). | ||
1807 | */ | ||
1808 | int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) | ||
1809 | { | ||
1810 | struct generic_pm_domain_data *gpd_data = NULL; | ||
1811 | bool remove = false; | ||
1812 | int ret = 0; | ||
1813 | |||
1814 | if (!(dev && dev->power.subsys_data)) | ||
1815 | return -EINVAL; | ||
1816 | |||
1817 | pm_runtime_disable(dev); | ||
1818 | device_pm_lock(); | ||
1819 | |||
1820 | spin_lock_irq(&dev->power.lock); | ||
1821 | |||
1822 | if (dev->power.subsys_data->domain_data) { | ||
1823 | gpd_data = to_gpd_data(dev->power.subsys_data->domain_data); | ||
1824 | gpd_data->ops = (struct gpd_dev_ops){ NULL }; | ||
1825 | if (clear_td) | ||
1826 | gpd_data->td = (struct gpd_timing_data){ 0 }; | ||
1827 | |||
1828 | if (--gpd_data->refcount == 0) { | ||
1829 | dev->power.subsys_data->domain_data = NULL; | ||
1830 | remove = true; | ||
1831 | } | ||
1832 | } else { | ||
1833 | ret = -EINVAL; | ||
1834 | } | ||
1835 | |||
1836 | spin_unlock_irq(&dev->power.lock); | ||
1837 | |||
1838 | device_pm_unlock(); | ||
1839 | pm_runtime_enable(dev); | ||
1840 | |||
1841 | if (ret) | ||
1842 | return ret; | ||
1843 | |||
1844 | dev_pm_put_subsys_data(dev); | ||
1845 | if (remove) | ||
1846 | __pm_genpd_free_dev_data(dev, gpd_data); | ||
1847 | |||
1848 | return 0; | ||
1849 | } | ||
1850 | EXPORT_SYMBOL_GPL(__pm_genpd_remove_callbacks); | ||
1851 | |||
1852 | /** | ||
1853 | * pm_genpd_attach_cpuidle - Connect the given PM domain with cpuidle. | 1747 | * pm_genpd_attach_cpuidle - Connect the given PM domain with cpuidle. |
1854 | * @genpd: PM domain to be connected with cpuidle. | 1748 | * @genpd: PM domain to be connected with cpuidle. |
1855 | * @state: cpuidle state this domain can disable/enable. | 1749 | * @state: cpuidle state this domain can disable/enable. |