From: Thierry Reding Date: Thu, 28 Mar 2013 20:35:04 +0000 (+0100) Subject: ARM: tegra: powergate: Don't error out if new state == old state X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eebd1fda2342014a50ed3fd132e5dc6e8b5251e8;p=linux-beck.git ARM: tegra: powergate: Don't error out if new state == old state Don't treat it as an error if a partition is already in the same power state when a user wants to power it on or off. This allows code to proceed if no state change is required. Signed-off-by: Thierry Reding Signed-off-by: Stephen Warren --- diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c index c472bed3245e..af9067e2867c 100644 --- a/arch/arm/mach-tegra/powergate.c +++ b/arch/arm/mach-tegra/powergate.c @@ -76,7 +76,7 @@ static int tegra_powergate_set(int id, bool new_state) if (status == new_state) { spin_unlock_irqrestore(&tegra_powergate_lock, flags); - return -EINVAL; + return 0; } pmc_write(PWRGATE_TOGGLE_START | id, PWRGATE_TOGGLE);