Skip to content

Commit d72d7d6

Browse files
committed
cpuidle: psci: Drop superfluous wrappers psci_dt_attach|detach_cpu()
To simplify the code, let's drop psci_dt_attach|detach_cpu() and use the common dt_idle_attach|detach_cpu() directly instead. Signed-off-by: Ulf Hansson <[email protected]> Reviewed-by: Sudeep Holla <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b1d4c60 commit d72d7d6

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

drivers/cpuidle/cpuidle-psci-domain.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/string.h>
2121

2222
#include "cpuidle-psci.h"
23+
#include "dt_idle_genpd.h"
2324

2425
struct psci_pd_provider {
2526
struct list_head link;

drivers/cpuidle/cpuidle-psci.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include "cpuidle-psci.h"
3030
#include "dt_idle_states.h"
31+
#include "dt_idle_genpd.h"
3132

3233
struct psci_cpuidle_data {
3334
u32 *psci_states;
@@ -224,7 +225,7 @@ static int psci_dt_cpu_init_topology(struct cpuidle_driver *drv,
224225
if (IS_ENABLED(CONFIG_PREEMPT_RT))
225226
return 0;
226227

227-
data->dev = psci_dt_attach_cpu(cpu);
228+
data->dev = dt_idle_attach_cpu(cpu, "psci");
228229
if (IS_ERR_OR_NULL(data->dev))
229230
return PTR_ERR_OR_ZERO(data->dev);
230231

@@ -311,7 +312,7 @@ static void psci_cpu_deinit_idle(int cpu)
311312
{
312313
struct psci_cpuidle_data *data = per_cpu_ptr(&psci_cpuidle_data, cpu);
313314

314-
psci_dt_detach_cpu(data->dev);
315+
dt_idle_detach_cpu(data->dev);
315316
psci_cpuidle_use_cpuhp = false;
316317
}
317318

drivers/cpuidle/cpuidle-psci.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,9 @@
33
#ifndef __CPUIDLE_PSCI_H
44
#define __CPUIDLE_PSCI_H
55

6-
struct device;
76
struct device_node;
87

98
void psci_set_domain_state(u32 state);
109
int psci_dt_parse_state_node(struct device_node *np, u32 *state);
1110

12-
#ifdef CONFIG_ARM_PSCI_CPUIDLE_DOMAIN
13-
14-
#include "dt_idle_genpd.h"
15-
16-
static inline struct device *psci_dt_attach_cpu(int cpu)
17-
{
18-
return dt_idle_attach_cpu(cpu, "psci");
19-
}
20-
21-
static inline void psci_dt_detach_cpu(struct device *dev)
22-
{
23-
dt_idle_detach_cpu(dev);
24-
}
25-
26-
#else
27-
static inline struct device *psci_dt_attach_cpu(int cpu) { return NULL; }
28-
static inline void psci_dt_detach_cpu(struct device *dev) { }
29-
#endif
30-
3111
#endif /* __CPUIDLE_PSCI_H */

0 commit comments

Comments
 (0)