summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2019-09-11 21:27:38 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-14 12:52:10 +0200
commit9bbaa740f6a86f04a27b5ed79ed7d6697123eae5 (patch)
treea688d3e428d924e72559c7cad97c168c6fbd19ac /arch
parenta672ca37ab530c3d8c88144ebcd9cb51b8cd9739 (diff)
downloadbarebox-9bbaa740f6a86f04a27b5ed79ed7d6697123eae5.tar.gz
barebox-9bbaa740f6a86f04a27b5ed79ed7d6697123eae5.tar.xz
state: provide dummy implementations for some functions when STATE is disabled
This allows to simplify some callers as can be seen from the phytec-som-am335x/board.c change. (The check for state != NULL could be dropped already before.) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/phytec-som-am335x/board.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/arm/boards/phytec-som-am335x/board.c b/arch/arm/boards/phytec-som-am335x/board.c
index 441d56348c..c25f33ae20 100644
--- a/arch/arm/boards/phytec-som-am335x/board.c
+++ b/arch/arm/boards/phytec-som-am335x/board.c
@@ -124,15 +124,11 @@ static int physom_devices_init(void)
ARRAY_SIZE(nandslots));
am33xx_bbu_emmc_mlo_register_handler("MLO.emmc", "/dev/mmc1");
- if (IS_ENABLED(CONFIG_STATE)) {
- state = state_by_name("am335x_phytec_mac_state");
- if (state)
- for (state_i = 0; state_i < 2; state_i++) {
- state_ret = state_read_mac(state,
- eth_names[state_i], &mac[0]);
- if (!state_ret && is_valid_ether_addr(&mac[0]))
- eth_register_ethaddr(state_i, mac);
- }
+ state = state_by_name("am335x_phytec_mac_state");
+ for (state_i = 0; state_i < 2; state_i++) {
+ state_ret = state_read_mac(state, eth_names[state_i], &mac[0]);
+ if (!state_ret && is_valid_ether_addr(&mac[0]))
+ eth_register_ethaddr(state_i, mac);
}
if (IS_ENABLED(CONFIG_PHYTEC_SOM_AM335X_OF_AUTOENABLE)) {