瀏覽代碼

Merge branch 'cpuidle/4.7' of http://git.linaro.org/people/daniel.lezcano/linux into tmp

Pull ARM cpuidle changes for v4.7 from Daniel Lezcano.

* 'cpuidle/4.7' of http://git.linaro.org/people/daniel.lezcano/linux:
  drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops
  soc: qcom: spm: Use const and __initconst for qcom_cpuidle_ops
  ARM: cpuidle: constify return value of arm_cpuidle_get_ops()
  ARM: cpuidle: add const qualifier to cpuidle_ops member in structures
Rafael J. Wysocki 9 年之前
父節點
當前提交
b5ebbcdb53
共有 4 個文件被更改,包括 6 次插入6 次删除
  1. 1 1
      arch/arm/include/asm/cpuidle.h
  2. 3 3
      arch/arm/kernel/cpuidle.c
  3. 1 1
      drivers/firmware/psci.c
  4. 1 1
      drivers/soc/qcom/spm.c

+ 1 - 1
arch/arm/include/asm/cpuidle.h

@@ -36,7 +36,7 @@ struct cpuidle_ops {
 
 
 struct of_cpuidle_method {
 struct of_cpuidle_method {
 	const char *method;
 	const char *method;
-	struct cpuidle_ops *ops;
+	const struct cpuidle_ops *ops;
 };
 };
 
 
 #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)			\
 #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)			\

+ 3 - 3
arch/arm/kernel/cpuidle.c

@@ -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)
  *
  *
  * 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)
 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)

+ 1 - 1
drivers/firmware/psci.c

@@ -355,7 +355,7 @@ int psci_cpu_suspend_enter(unsigned long index)
 
 
 /* ARM specific CPU idle operations */
 /* ARM specific CPU idle operations */
 #ifdef CONFIG_ARM
 #ifdef CONFIG_ARM
-static struct cpuidle_ops psci_cpuidle_ops __initdata = {
+static const struct cpuidle_ops psci_cpuidle_ops __initconst = {
 	.suspend = psci_cpu_suspend_enter,
 	.suspend = psci_cpu_suspend_enter,
 	.init = psci_dt_cpu_init_idle,
 	.init = psci_dt_cpu_init_idle,
 };
 };

+ 1 - 1
drivers/soc/qcom/spm.c

@@ -274,7 +274,7 @@ check_spm:
 	return per_cpu(cpu_spm_drv, cpu) ? 0 : -ENXIO;
 	return per_cpu(cpu_spm_drv, cpu) ? 0 : -ENXIO;
 }
 }
 
 
-static struct cpuidle_ops qcom_cpuidle_ops __initdata = {
+static const struct cpuidle_ops qcom_cpuidle_ops __initconst = {
 	.suspend = qcom_idle_enter,
 	.suspend = qcom_idle_enter,
 	.init = qcom_cpuidle_init,
 	.init = qcom_cpuidle_init,
 };
 };