ARM: cleanup: pwrdm_can_ever_lose_context() checking
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 24 Feb 2013 10:55:24 +0000 (10:55 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 24 Feb 2013 10:55:24 +0000 (10:55 +0000)
pwrdm_can_ever_lose_context() is only ever called from the OMAP GPIO
code, and only with a pointer returned from omap_hwmod_get_pwrdm().
omap_hwmod_get_pwrdm() only ever returns NULL on error, so using
IS_ERR_OR_NULL() to validate the passed pointer is silly.  Use a
simpler !ptr check instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-omap2/powerdomain.c

index dea62a9aad0751d77796b5c3fbbba513c9ae6f02..36a69189b08339e20ff55fcf25752357799aa611 100644 (file)
@@ -1054,7 +1054,7 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
 {
        int i;
 
-       if (IS_ERR_OR_NULL(pwrdm)) {
+       if (!pwrdm) {
                pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
                         __func__);
                return 1;