aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpuidle/cpuidle-arm64.c13
-rw-r--r--drivers/cpuidle/dt_idle_states.c10
2 files changed, 11 insertions, 12 deletions
diff --git a/drivers/cpuidle/cpuidle-arm64.c b/drivers/cpuidle/cpuidle-arm64.c
index 50997ea942fc..1b10f92ecd5a 100644
--- a/drivers/cpuidle/cpuidle-arm64.c
+++ b/drivers/cpuidle/cpuidle-arm64.c
@@ -104,11 +104,8 @@ static int __init arm64_idle_init(void)
104 * reason to initialize the idle driver if only wfi is supported. 104 * reason to initialize the idle driver if only wfi is supported.
105 */ 105 */
106 ret = dt_init_idle_driver(drv, arm64_idle_state_match, 1); 106 ret = dt_init_idle_driver(drv, arm64_idle_state_match, 1);
107 if (ret <= 0) { 107 if (ret <= 0)
108 if (ret)
109 pr_err("failed to initialize idle states\n");
110 return ret ? : -ENODEV; 108 return ret ? : -ENODEV;
111 }
112 109
113 /* 110 /*
114 * Call arch CPU operations in order to initialize 111 * Call arch CPU operations in order to initialize
@@ -122,12 +119,6 @@ static int __init arm64_idle_init(void)
122 } 119 }
123 } 120 }
124 121
125 ret = cpuidle_register(drv, NULL); 122 return cpuidle_register(drv, NULL);
126 if (ret) {
127 pr_err("failed to register cpuidle driver\n");
128 return ret;
129 }
130
131 return 0;
132} 123}
133device_initcall(arm64_idle_init); 124device_initcall(arm64_idle_init);
diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
index 52f4d11bbf3f..5301912cb84e 100644
--- a/drivers/cpuidle/dt_idle_states.c
+++ b/drivers/cpuidle/dt_idle_states.c
@@ -27,6 +27,7 @@ static int init_state_node(struct cpuidle_state *idle_state,
27{ 27{
28 int err; 28 int err;
29 const struct of_device_id *match_id; 29 const struct of_device_id *match_id;
30 const char *desc;
30 31
31 match_id = of_match_node(matches, state_node); 32 match_id = of_match_node(matches, state_node);
32 if (!match_id) 33 if (!match_id)
@@ -73,6 +74,10 @@ static int init_state_node(struct cpuidle_state *idle_state,
73 return -EINVAL; 74 return -EINVAL;
74 } 75 }
75 76
77 err = of_property_read_string(state_node, "idle-state-name", &desc);
78 if (err)
79 desc = state_node->name;
80
76 idle_state->flags = CPUIDLE_FLAG_TIME_VALID; 81 idle_state->flags = CPUIDLE_FLAG_TIME_VALID;
77 if (of_property_read_bool(state_node, "local-timer-stop")) 82 if (of_property_read_bool(state_node, "local-timer-stop"))
78 idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP; 83 idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP;
@@ -82,7 +87,7 @@ static int init_state_node(struct cpuidle_state *idle_state,
82 * and desc become string pointers 87 * and desc become string pointers
83 */ 88 */
84 strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1); 89 strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1);
85 strncpy(idle_state->desc, state_node->name, CPUIDLE_DESC_LEN - 1); 90 strncpy(idle_state->desc, desc, CPUIDLE_DESC_LEN - 1);
86 return 0; 91 return 0;
87} 92}
88 93
@@ -169,6 +174,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
169 if (!state_node) 174 if (!state_node)
170 break; 175 break;
171 176
177 if (!of_device_is_available(state_node))
178 continue;
179
172 if (!idle_state_valid(state_node, i, cpumask)) { 180 if (!idle_state_valid(state_node, i, cpumask)) {
173 pr_warn("%s idle state not valid, bailing out\n", 181 pr_warn("%s idle state not valid, bailing out\n",
174 state_node->full_name); 182 state_node->full_name);