[PATCH 05/12] ARM: OMAP2+: powerdomain: remove some redundant checks; add some notes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove some redundant tests in static functions, and add some comments
to some code that should have future attention.

Signed-off-by: Paul Walmsley <paul@xxxxxxxxx?>
---
 arch/arm/mach-omap2/powerdomain.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 658f4ed..62e2f75 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -95,7 +95,7 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
 	int i;
 	struct voltagedomain *voltdm;
 
-	if (!pwrdm || !pwrdm->name)
+	if (!pwrdm->name)
 		return -EINVAL;
 
 	if (cpu_is_omap44xx() &&
@@ -528,9 +528,6 @@ static int _pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
 {
 	int ret = -EINVAL;
 
-	if (!pwrdm)
-		return -EINVAL;
-
 	if (pwrdm->banks < (bank + 1))
 		return -EEXIST;
 
@@ -566,9 +563,6 @@ static int _pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
 {
 	int ret = -EINVAL;
 
-	if (!pwrdm)
-		return -EINVAL;
-
 	if (pwrdm->banks < (bank + 1))
 		return -EEXIST;
 
@@ -635,6 +629,11 @@ static void _pwrdm_state_switch(struct powerdomain *pwrdm)
 
 static int _pwrdm_pre_transition_cb(struct powerdomain *pwrdm, void *unused)
 {
+	/*
+	 * XXX It should be possible to avoid the clear_all_prev_pwrst
+	 * call for powerdomains if we are programming them to stay on,
+	 * for example.
+	 */
 	pwrdm_clear_all_prev_pwrst(pwrdm);
 	_pwrdm_state_switch(pwrdm);
 	return 0;
@@ -1000,6 +999,11 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
 		return ret;
 
 	/*
+	 * XXX Is there some way for us to skip powerdomains that
+	 * don't have a prev pwrst register?
+	 */
+
+	/*
 	 * XXX should get the powerdomain's current state here;
 	 * warn & fail if it is not ON.
 	 */


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux