Skip to content

Commit

Permalink
powerpc/512x: Make mpc512x_select_reset_compat() static
Browse files Browse the repository at this point in the history
mpc512x_select_reset_compat() is only used in the file it
is defined.

Make it static.

Move mpc512x_restart_init() after mpc512x_select_reset_compat().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/36a19e13025dbf17e92e832dd24150642b0e9bad.1692341499.git.christophe.leroy@csgroup.eu
  • Loading branch information
Christophe Leroy authored and Michael Ellerman committed Aug 18, 2023
1 parent f94a84a commit be92207
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion arch/powerpc/platforms/512x/mpc512x.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ extern void __init mpc512x_init(void);
extern void __init mpc512x_setup_arch(void);
extern int __init mpc5121_clk_init(void);
const char *__init mpc512x_select_psc_compat(void);
const char *__init mpc512x_select_reset_compat(void);
extern void __noreturn mpc512x_restart(char *cmd);

#endif /* __MPC512X_H__ */
30 changes: 15 additions & 15 deletions arch/powerpc/platforms/512x/mpc512x_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@

static struct mpc512x_reset_module __iomem *reset_module_base;

static void __init mpc512x_restart_init(void)
{
struct device_node *np;
const char *reset_compat;

reset_compat = mpc512x_select_reset_compat();
np = of_find_compatible_node(NULL, NULL, reset_compat);
if (!np)
return;

reset_module_base = of_iomap(np, 0);
of_node_put(np);
}

void __noreturn mpc512x_restart(char *cmd)
{
if (reset_module_base) {
Expand Down Expand Up @@ -363,7 +349,7 @@ const char *__init mpc512x_select_psc_compat(void)
return NULL;
}

const char *__init mpc512x_select_reset_compat(void)
static const char *__init mpc512x_select_reset_compat(void)
{
if (of_machine_is_compatible("fsl,mpc5121"))
return "fsl,mpc5121-reset";
Expand Down Expand Up @@ -455,6 +441,20 @@ static void __init mpc512x_psc_fifo_init(void)
}
}

static void __init mpc512x_restart_init(void)
{
struct device_node *np;
const char *reset_compat;

reset_compat = mpc512x_select_reset_compat();
np = of_find_compatible_node(NULL, NULL, reset_compat);
if (!np)
return;

reset_module_base = of_iomap(np, 0);
of_node_put(np);
}

void __init mpc512x_init_early(void)
{
mpc512x_restart_init();
Expand Down

0 comments on commit be92207

Please sign in to comment.