aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2014-10-02 15:12:34 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-03 09:43:14 -0400
commitf39cb1797ec1094b196d3dab44a7ca6060813d38 (patch)
treee09fbb2c426018fa3da64a1506901a74c67f46fe /drivers/base
parentf48c767ce8951e30eb716b8ef69142d21aacbd1d (diff)
PM / Domains: Rename cpu_data to cpuidle_data
The "cpu_data" are defined for some archs and thus conflicting with the "cpu_data" member in the struct gpd_cpu_data. This causes a compiler error for those archs. Let's fix it by rename the member to cpuidle_data. In this context it also seems appropriate to rename the struct to gpd_cpuidle_data to better reflect its use. Fixes: f48c767ce895 (PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h) Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 18cc68d058d6..40bc2f4072cc 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -142,13 +142,13 @@ static void genpd_recalc_cpu_exit_latency(struct generic_pm_domain *genpd)
142{ 142{
143 s64 usecs64; 143 s64 usecs64;
144 144
145 if (!genpd->cpu_data) 145 if (!genpd->cpuidle_data)
146 return; 146 return;
147 147
148 usecs64 = genpd->power_on_latency_ns; 148 usecs64 = genpd->power_on_latency_ns;
149 do_div(usecs64, NSEC_PER_USEC); 149 do_div(usecs64, NSEC_PER_USEC);
150 usecs64 += genpd->cpu_data->saved_exit_latency; 150 usecs64 += genpd->cpuidle_data->saved_exit_latency;
151 genpd->cpu_data->idle_state->exit_latency = usecs64; 151 genpd->cpuidle_data->idle_state->exit_latency = usecs64;
152} 152}
153 153
154/** 154/**
@@ -188,9 +188,9 @@ static int __pm_genpd_poweron(struct generic_pm_domain *genpd)
188 return 0; 188 return 0;
189 } 189 }
190 190
191 if (genpd->cpu_data) { 191 if (genpd->cpuidle_data) {
192 cpuidle_pause_and_lock(); 192 cpuidle_pause_and_lock();
193 genpd->cpu_data->idle_state->disabled = true; 193 genpd->cpuidle_data->idle_state->disabled = true;
194 cpuidle_resume_and_unlock(); 194 cpuidle_resume_and_unlock();
195 goto out; 195 goto out;
196 } 196 }
@@ -513,17 +513,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
513 } 513 }
514 } 514 }
515 515
516 if (genpd->cpu_data) { 516 if (genpd->cpuidle_data) {
517 /* 517 /*
518 * If cpu_data is set, cpuidle should turn the domain off when 518 * If cpuidle_data is set, cpuidle should turn the domain off
519 * the CPU in it is idle. In that case we don't decrement the 519 * when the CPU in it is idle. In that case we don't decrement
520 * subdomain counts of the master domains, so that power is not 520 * the subdomain counts of the master domains, so that power is
521 * removed from the current domain prematurely as a result of 521 * not removed from the current domain prematurely as a result
522 * cutting off the masters' power. 522 * of cutting off the masters' power.
523 */ 523 */
524 genpd->status = GPD_STATE_POWER_OFF; 524 genpd->status = GPD_STATE_POWER_OFF;
525 cpuidle_pause_and_lock(); 525 cpuidle_pause_and_lock();
526 genpd->cpu_data->idle_state->disabled = false; 526 genpd->cpuidle_data->idle_state->disabled = false;
527 cpuidle_resume_and_unlock(); 527 cpuidle_resume_and_unlock();
528 goto out; 528 goto out;
529 } 529 }
@@ -1698,7 +1698,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
1698int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) 1698int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
1699{ 1699{
1700 struct cpuidle_driver *cpuidle_drv; 1700 struct cpuidle_driver *cpuidle_drv;
1701 struct gpd_cpu_data *cpu_data; 1701 struct gpd_cpuidle_data *cpuidle_data;
1702 struct cpuidle_state *idle_state; 1702 struct cpuidle_state *idle_state;
1703 int ret = 0; 1703 int ret = 0;
1704 1704
@@ -1707,12 +1707,12 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
1707 1707
1708 genpd_acquire_lock(genpd); 1708 genpd_acquire_lock(genpd);
1709 1709
1710 if (genpd->cpu_data) { 1710 if (genpd->cpuidle_data) {
1711 ret = -EEXIST; 1711 ret = -EEXIST;
1712 goto out; 1712 goto out;
1713 } 1713 }
1714 cpu_data = kzalloc(sizeof(*cpu_data), GFP_KERNEL); 1714 cpuidle_data = kzalloc(sizeof(*cpuidle_data), GFP_KERNEL);
1715 if (!cpu_data) { 1715 if (!cpuidle_data) {
1716 ret = -ENOMEM; 1716 ret = -ENOMEM;
1717 goto out; 1717 goto out;
1718 } 1718 }
@@ -1730,9 +1730,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
1730 ret = -EAGAIN; 1730 ret = -EAGAIN;
1731 goto err; 1731 goto err;
1732 } 1732 }
1733 cpu_data->idle_state = idle_state; 1733 cpuidle_data->idle_state = idle_state;
1734 cpu_data->saved_exit_latency = idle_state->exit_latency; 1734 cpuidle_data->saved_exit_latency = idle_state->exit_latency;
1735 genpd->cpu_data = cpu_data; 1735 genpd->cpuidle_data = cpuidle_data;
1736 genpd_recalc_cpu_exit_latency(genpd); 1736 genpd_recalc_cpu_exit_latency(genpd);
1737 1737
1738 out: 1738 out:
@@ -1743,7 +1743,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
1743 cpuidle_driver_unref(); 1743 cpuidle_driver_unref();
1744 1744
1745 err_drv: 1745 err_drv:
1746 kfree(cpu_data); 1746 kfree(cpuidle_data);
1747 goto out; 1747 goto out;
1748} 1748}
1749 1749
@@ -1766,7 +1766,7 @@ int pm_genpd_name_attach_cpuidle(const char *name, int state)
1766 */ 1766 */
1767int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) 1767int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
1768{ 1768{
1769 struct gpd_cpu_data *cpu_data; 1769 struct gpd_cpuidle_data *cpuidle_data;
1770 struct cpuidle_state *idle_state; 1770 struct cpuidle_state *idle_state;
1771 int ret = 0; 1771 int ret = 0;
1772 1772
@@ -1775,20 +1775,20 @@ int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
1775 1775
1776 genpd_acquire_lock(genpd); 1776 genpd_acquire_lock(genpd);
1777 1777
1778 cpu_data = genpd->cpu_data; 1778 cpuidle_data = genpd->cpuidle_data;
1779 if (!cpu_data) { 1779 if (!cpuidle_data) {
1780 ret = -ENODEV; 1780 ret = -ENODEV;
1781 goto out; 1781 goto out;
1782 } 1782 }
1783 idle_state = cpu_data->idle_state; 1783 idle_state = cpuidle_data->idle_state;
1784 if (!idle_state->disabled) { 1784 if (!idle_state->disabled) {
1785 ret = -EAGAIN; 1785 ret = -EAGAIN;
1786 goto out; 1786 goto out;
1787 } 1787 }
1788 idle_state->exit_latency = cpu_data->saved_exit_latency; 1788 idle_state->exit_latency = cpuidle_data->saved_exit_latency;
1789 cpuidle_driver_unref(); 1789 cpuidle_driver_unref();
1790 genpd->cpu_data = NULL; 1790 genpd->cpuidle_data = NULL;
1791 kfree(cpu_data); 1791 kfree(cpuidle_data);
1792 1792
1793 out: 1793 out:
1794 genpd_release_lock(genpd); 1794 genpd_release_lock(genpd);