Message ID | 537d604eeb14149783c1bb398af9f4c9a82374d0.1606492351.git.stefan@agner.ch |
---|---|
State | Accepted, archived |
Commit | cf47c0e23a25f10ea87fdb3ac4b1e4ea14823e16 |
Delegated to: | Neil Armstrong |
Headers | show |
Series | [1/2] ARM: meson: isolate loading of socinfo | expand |
On 27/11/2020 17:28, Stefan Agner wrote: > Move loading of socinfo into a separate function so the value can be > reused later. > > Signed-off-by: Stefan Agner <stefan@agner.ch> > --- > > arch/arm/mach-meson/board-info.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-meson/board-info.c b/arch/arm/mach-meson/board-info.c > index e61d1adb10..a0bcf38f29 100644 > --- a/arch/arm/mach-meson/board-info.c > +++ b/arch/arm/mach-meson/board-info.c > @@ -131,7 +131,7 @@ static void print_board_model(void) > printf("Model: %s\n", model ? model : "Unknown"); > } > > -int show_board_info(void) > +static unsigned int get_socinfo(void) > { > struct regmap *regmap; > int nodeoffset, ret; > @@ -163,8 +163,20 @@ int show_board_info(void) > return 0; > } > > + return socinfo; > +} > + > +int show_board_info(void) > +{ > + unsigned int socinfo; > + > /* print board information */ > print_board_model(); > + > + socinfo = get_socinfo(); > + if (!socinfo) > + return 0; > + > printf("SoC: Amlogic Meson %s (%s) Revision %x:%x (%x:%x)\n", > socinfo_to_soc_id(socinfo), > socinfo_to_package_id(socinfo), > Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Applying it u-boot-amlogic-next Thanks ! Neil
diff --git a/arch/arm/mach-meson/board-info.c b/arch/arm/mach-meson/board-info.c index e61d1adb10..a0bcf38f29 100644 --- a/arch/arm/mach-meson/board-info.c +++ b/arch/arm/mach-meson/board-info.c @@ -131,7 +131,7 @@ static void print_board_model(void) printf("Model: %s\n", model ? model : "Unknown"); } -int show_board_info(void) +static unsigned int get_socinfo(void) { struct regmap *regmap; int nodeoffset, ret; @@ -163,8 +163,20 @@ int show_board_info(void) return 0; } + return socinfo; +} + +int show_board_info(void) +{ + unsigned int socinfo; + /* print board information */ print_board_model(); + + socinfo = get_socinfo(); + if (!socinfo) + return 0; + printf("SoC: Amlogic Meson %s (%s) Revision %x:%x (%x:%x)\n", socinfo_to_soc_id(socinfo), socinfo_to_package_id(socinfo),
Move loading of socinfo into a separate function so the value can be reused later. Signed-off-by: Stefan Agner <stefan@agner.ch> --- arch/arm/mach-meson/board-info.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)