diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-09-03 06:52:18 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-08 18:46:11 -0400 |
commit | 67da6d4bf43c4208433ef8f3ee487401b4dc9c74 (patch) | |
tree | 51bc5e58a1867152f3dcb0eb57b3be7dd6f3f1d3 /drivers/base | |
parent | 55e15c949fd05d247a889df0ed0177a676fec665 (diff) |
PM / domains: Ignore callbacks for subsys generic_pm_domain_data
In a step of simplifying the generic power domain let's move away from
using these callbacks.
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 | 131 |
1 files changed, 8 insertions, 123 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index e613e3cb96d8..aa5b14c1e643 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -25,10 +25,6 @@ | |||
25 | __routine = genpd->dev_ops.callback; \ | 25 | __routine = genpd->dev_ops.callback; \ |
26 | if (__routine) { \ | 26 | if (__routine) { \ |
27 | __ret = __routine(dev); \ | 27 | __ret = __routine(dev); \ |
28 | } else { \ | ||
29 | __routine = dev_gpd_data(dev)->ops.callback; \ | ||
30 | if (__routine) \ | ||
31 | __ret = __routine(dev); \ | ||
32 | } \ | 28 | } \ |
33 | __ret; \ | 29 | __ret; \ |
34 | }) | 30 | }) |
@@ -1871,10 +1867,6 @@ static int pm_genpd_default_save_state(struct device *dev) | |||
1871 | { | 1867 | { |
1872 | int (*cb)(struct device *__dev); | 1868 | int (*cb)(struct device *__dev); |
1873 | 1869 | ||
1874 | cb = dev_gpd_data(dev)->ops.save_state; | ||
1875 | if (cb) | ||
1876 | return cb(dev); | ||
1877 | |||
1878 | if (dev->type && dev->type->pm) | 1870 | if (dev->type && dev->type->pm) |
1879 | cb = dev->type->pm->runtime_suspend; | 1871 | cb = dev->type->pm->runtime_suspend; |
1880 | else if (dev->class && dev->class->pm) | 1872 | else if (dev->class && dev->class->pm) |
@@ -1898,10 +1890,6 @@ static int pm_genpd_default_restore_state(struct device *dev) | |||
1898 | { | 1890 | { |
1899 | int (*cb)(struct device *__dev); | 1891 | int (*cb)(struct device *__dev); |
1900 | 1892 | ||
1901 | cb = dev_gpd_data(dev)->ops.restore_state; | ||
1902 | if (cb) | ||
1903 | return cb(dev); | ||
1904 | |||
1905 | if (dev->type && dev->type->pm) | 1893 | if (dev->type && dev->type->pm) |
1906 | cb = dev->type->pm->runtime_resume; | 1894 | cb = dev->type->pm->runtime_resume; |
1907 | else if (dev->class && dev->class->pm) | 1895 | else if (dev->class && dev->class->pm) |
@@ -1917,109 +1905,6 @@ static int pm_genpd_default_restore_state(struct device *dev) | |||
1917 | return cb ? cb(dev) : 0; | 1905 | return cb ? cb(dev) : 0; |
1918 | } | 1906 | } |
1919 | 1907 | ||
1920 | #ifdef CONFIG_PM_SLEEP | ||
1921 | |||
1922 | /** | ||
1923 | * pm_genpd_default_suspend - Default "device suspend" for PM domians. | ||
1924 | * @dev: Device to handle. | ||
1925 | */ | ||
1926 | static int pm_genpd_default_suspend(struct device *dev) | ||
1927 | { | ||
1928 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend; | ||
1929 | |||
1930 | return cb ? cb(dev) : pm_generic_suspend(dev); | ||
1931 | } | ||
1932 | |||
1933 | /** | ||
1934 | * pm_genpd_default_suspend_late - Default "late device suspend" for PM domians. | ||
1935 | * @dev: Device to handle. | ||
1936 | */ | ||
1937 | static int pm_genpd_default_suspend_late(struct device *dev) | ||
1938 | { | ||
1939 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend_late; | ||
1940 | |||
1941 | return cb ? cb(dev) : pm_generic_suspend_late(dev); | ||
1942 | } | ||
1943 | |||
1944 | /** | ||
1945 | * pm_genpd_default_resume_early - Default "early device resume" for PM domians. | ||
1946 | * @dev: Device to handle. | ||
1947 | */ | ||
1948 | static int pm_genpd_default_resume_early(struct device *dev) | ||
1949 | { | ||
1950 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume_early; | ||
1951 | |||
1952 | return cb ? cb(dev) : pm_generic_resume_early(dev); | ||
1953 | } | ||
1954 | |||
1955 | /** | ||
1956 | * pm_genpd_default_resume - Default "device resume" for PM domians. | ||
1957 | * @dev: Device to handle. | ||
1958 | */ | ||
1959 | static int pm_genpd_default_resume(struct device *dev) | ||
1960 | { | ||
1961 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume; | ||
1962 | |||
1963 | return cb ? cb(dev) : pm_generic_resume(dev); | ||
1964 | } | ||
1965 | |||
1966 | /** | ||
1967 | * pm_genpd_default_freeze - Default "device freeze" for PM domians. | ||
1968 | * @dev: Device to handle. | ||
1969 | */ | ||
1970 | static int pm_genpd_default_freeze(struct device *dev) | ||
1971 | { | ||
1972 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze; | ||
1973 | |||
1974 | return cb ? cb(dev) : pm_generic_freeze(dev); | ||
1975 | } | ||
1976 | |||
1977 | /** | ||
1978 | * pm_genpd_default_freeze_late - Default "late device freeze" for PM domians. | ||
1979 | * @dev: Device to handle. | ||
1980 | */ | ||
1981 | static int pm_genpd_default_freeze_late(struct device *dev) | ||
1982 | { | ||
1983 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze_late; | ||
1984 | |||
1985 | return cb ? cb(dev) : pm_generic_freeze_late(dev); | ||
1986 | } | ||
1987 | |||
1988 | /** | ||
1989 | * pm_genpd_default_thaw_early - Default "early device thaw" for PM domians. | ||
1990 | * @dev: Device to handle. | ||
1991 | */ | ||
1992 | static int pm_genpd_default_thaw_early(struct device *dev) | ||
1993 | { | ||
1994 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw_early; | ||
1995 | |||
1996 | return cb ? cb(dev) : pm_generic_thaw_early(dev); | ||
1997 | } | ||
1998 | |||
1999 | /** | ||
2000 | * pm_genpd_default_thaw - Default "device thaw" for PM domians. | ||
2001 | * @dev: Device to handle. | ||
2002 | */ | ||
2003 | static int pm_genpd_default_thaw(struct device *dev) | ||
2004 | { | ||
2005 | int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw; | ||
2006 | |||
2007 | return cb ? cb(dev) : pm_generic_thaw(dev); | ||
2008 | } | ||
2009 | |||
2010 | #else /* !CONFIG_PM_SLEEP */ | ||
2011 | |||
2012 | #define pm_genpd_default_suspend NULL | ||
2013 | #define pm_genpd_default_suspend_late NULL | ||
2014 | #define pm_genpd_default_resume_early NULL | ||
2015 | #define pm_genpd_default_resume NULL | ||
2016 | #define pm_genpd_default_freeze NULL | ||
2017 | #define pm_genpd_default_freeze_late NULL | ||
2018 | #define pm_genpd_default_thaw_early NULL | ||
2019 | #define pm_genpd_default_thaw NULL | ||
2020 | |||
2021 | #endif /* !CONFIG_PM_SLEEP */ | ||
2022 | |||
2023 | /** | 1908 | /** |
2024 | * pm_genpd_init - Initialize a generic I/O PM domain object. | 1909 | * pm_genpd_init - Initialize a generic I/O PM domain object. |
2025 | * @genpd: PM domain object to initialize. | 1910 | * @genpd: PM domain object to initialize. |
@@ -2071,14 +1956,14 @@ void pm_genpd_init(struct generic_pm_domain *genpd, | |||
2071 | genpd->domain.ops.complete = pm_genpd_complete; | 1956 | genpd->domain.ops.complete = pm_genpd_complete; |
2072 | genpd->dev_ops.save_state = pm_genpd_default_save_state; | 1957 | genpd->dev_ops.save_state = pm_genpd_default_save_state; |
2073 | genpd->dev_ops.restore_state = pm_genpd_default_restore_state; | 1958 | genpd->dev_ops.restore_state = pm_genpd_default_restore_state; |
2074 | genpd->dev_ops.suspend = pm_genpd_default_suspend; | 1959 | genpd->dev_ops.suspend = pm_generic_suspend; |
2075 | genpd->dev_ops.suspend_late = pm_genpd_default_suspend_late; | 1960 | genpd->dev_ops.suspend_late = pm_generic_suspend_late; |
2076 | genpd->dev_ops.resume_early = pm_genpd_default_resume_early; | 1961 | genpd->dev_ops.resume_early = pm_generic_resume_early; |
2077 | genpd->dev_ops.resume = pm_genpd_default_resume; | 1962 | genpd->dev_ops.resume = pm_generic_resume; |
2078 | genpd->dev_ops.freeze = pm_genpd_default_freeze; | 1963 | genpd->dev_ops.freeze = pm_generic_freeze; |
2079 | genpd->dev_ops.freeze_late = pm_genpd_default_freeze_late; | 1964 | genpd->dev_ops.freeze_late = pm_generic_freeze_late; |
2080 | genpd->dev_ops.thaw_early = pm_genpd_default_thaw_early; | 1965 | genpd->dev_ops.thaw_early = pm_generic_thaw_early; |
2081 | genpd->dev_ops.thaw = pm_genpd_default_thaw; | 1966 | genpd->dev_ops.thaw = pm_generic_thaw; |
2082 | mutex_lock(&gpd_list_lock); | 1967 | mutex_lock(&gpd_list_lock); |
2083 | list_add(&genpd->gpd_list_node, &gpd_list); | 1968 | list_add(&genpd->gpd_list_node, &gpd_list); |
2084 | mutex_unlock(&gpd_list_lock); | 1969 | mutex_unlock(&gpd_list_lock); |