ARM: meson: isolate loading of socinfo
Move loading of socinfo into a separate function so the value can be reused later. Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
		
							parent
							
								
									ade0100a91
								
							
						
					
					
						commit
						cf47c0e23a
					
				| 
						 | 
					@ -131,7 +131,7 @@ static void print_board_model(void)
 | 
				
			||||||
	printf("Model: %s\n", model ? model : "Unknown");
 | 
						printf("Model: %s\n", model ? model : "Unknown");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int show_board_info(void)
 | 
					static unsigned int get_socinfo(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct regmap *regmap;
 | 
						struct regmap *regmap;
 | 
				
			||||||
	int nodeoffset, ret;
 | 
						int nodeoffset, ret;
 | 
				
			||||||
| 
						 | 
					@ -163,8 +163,20 @@ int show_board_info(void)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return socinfo;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int show_board_info(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						unsigned int socinfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* print board information */
 | 
						/* print board information */
 | 
				
			||||||
	print_board_model();
 | 
						print_board_model();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						socinfo = get_socinfo();
 | 
				
			||||||
 | 
						if (!socinfo)
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printf("SoC:   Amlogic Meson %s (%s) Revision %x:%x (%x:%x)\n",
 | 
						printf("SoC:   Amlogic Meson %s (%s) Revision %x:%x (%x:%x)\n",
 | 
				
			||||||
	       socinfo_to_soc_id(socinfo),
 | 
						       socinfo_to_soc_id(socinfo),
 | 
				
			||||||
	       socinfo_to_package_id(socinfo),
 | 
						       socinfo_to_package_id(socinfo),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue