| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * CPU frequency scaling for OMAP using OPP information |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * Copyright (C) 2007-2011 Texas Instruments, Inc. |
|---|
| 10 | 11 | * - OMAP3/4 support by Rajendra Nayak, Santosh Shilimkar |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 13 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 14 | | - * published by the Free Software Foundation. |
|---|
| 15 | 12 | */ |
|---|
| 16 | 13 | |
|---|
| 17 | 14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| .. | .. |
|---|
| 125 | 122 | dev_err(mpu_dev, |
|---|
| 126 | 123 | "%s: cpu%d: failed creating freq table[%d]\n", |
|---|
| 127 | 124 | __func__, policy->cpu, result); |
|---|
| 128 | | - goto fail; |
|---|
| 125 | + clk_put(policy->clk); |
|---|
| 126 | + return result; |
|---|
| 129 | 127 | } |
|---|
| 130 | 128 | } |
|---|
| 131 | 129 | |
|---|
| 132 | 130 | atomic_inc_return(&freq_table_users); |
|---|
| 133 | 131 | |
|---|
| 134 | 132 | /* FIXME: what's the actual transition time? */ |
|---|
| 135 | | - result = cpufreq_generic_init(policy, freq_table, 300 * 1000); |
|---|
| 136 | | - if (!result) |
|---|
| 137 | | - return 0; |
|---|
| 133 | + cpufreq_generic_init(policy, freq_table, 300 * 1000); |
|---|
| 134 | + dev_pm_opp_of_register_em(mpu_dev, policy->cpus); |
|---|
| 138 | 135 | |
|---|
| 139 | | - freq_table_free(); |
|---|
| 140 | | -fail: |
|---|
| 141 | | - clk_put(policy->clk); |
|---|
| 142 | | - return result; |
|---|
| 136 | + return 0; |
|---|
| 143 | 137 | } |
|---|
| 144 | 138 | |
|---|
| 145 | 139 | static int omap_cpu_exit(struct cpufreq_policy *policy) |
|---|