Commit 4cfd5520 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Daniel Lezcano

ARM: cpuidle: constify return value of arm_cpuidle_get_ops()

arm_cpuidle_read_ops() just copies '*ops' to cpuidle_ops[cpu], so the
structure '*ops' is not modified at all.

The comment is also updated accordingly.
Signed-off-by: default avatarJisheng Zhang <jszhang@marvell.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 33475a87
...@@ -70,7 +70,7 @@ int arm_cpuidle_suspend(int index) ...@@ -70,7 +70,7 @@ int arm_cpuidle_suspend(int index)
* *
* Returns a struct cpuidle_ops pointer, NULL if not found. * Returns a struct cpuidle_ops pointer, NULL if not found.
*/ */
static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method) static const struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method)
{ {
struct of_cpuidle_method *m = __cpuidle_method_of_table; struct of_cpuidle_method *m = __cpuidle_method_of_table;
...@@ -88,7 +88,7 @@ static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method) ...@@ -88,7 +88,7 @@ static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method)
* *
* Get the method name defined in the 'enable-method' property, retrieve the * Get the method name defined in the 'enable-method' property, retrieve the
* associated cpuidle_ops and do a struct copy. This copy is needed because all * associated cpuidle_ops and do a struct copy. This copy is needed because all
* cpuidle_ops are tagged __initdata and will be unloaded after the init * cpuidle_ops are tagged __initconst and will be unloaded after the init
* process. * process.
* *
* Return 0 on sucess, -ENOENT if no 'enable-method' is defined, -EOPNOTSUPP if * Return 0 on sucess, -ENOENT if no 'enable-method' is defined, -EOPNOTSUPP if
...@@ -97,7 +97,7 @@ static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method) ...@@ -97,7 +97,7 @@ static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method)
static int __init arm_cpuidle_read_ops(struct device_node *dn, int cpu) static int __init arm_cpuidle_read_ops(struct device_node *dn, int cpu)
{ {
const char *enable_method; const char *enable_method;
struct cpuidle_ops *ops; const struct cpuidle_ops *ops;
enable_method = of_get_property(dn, "enable-method", NULL); enable_method = of_get_property(dn, "enable-method", NULL);
if (!enable_method) if (!enable_method)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment