| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * OMAP powerdomain control |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * Written by Paul Walmsley |
|---|
| 8 | 9 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> |
|---|
| 9 | 10 | * State counting code by Tero Kristo <tero.kristo@nokia.com> |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 12 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 13 | | - * published by the Free Software Foundation. |
|---|
| 14 | 11 | */ |
|---|
| 15 | 12 | #undef DEBUG |
|---|
| 16 | 13 | |
|---|
| .. | .. |
|---|
| 177 | 174 | break; |
|---|
| 178 | 175 | case PWRDM_STATE_PREV: |
|---|
| 179 | 176 | prev = pwrdm_read_prev_pwrst(pwrdm); |
|---|
| 180 | | - if (pwrdm->state != prev) |
|---|
| 177 | + if (prev >= 0 && pwrdm->state != prev) |
|---|
| 181 | 178 | pwrdm->state_counter[prev]++; |
|---|
| 182 | 179 | if (prev == PWRDM_POWER_RET) |
|---|
| 183 | 180 | _update_logic_membank_counters(pwrdm); |
|---|