summaryrefslogtreecommitdiffstats
path: root/common/state
Commit message (Collapse)AuthorAgeFilesLines
* fdt: Check blob size during unflatteningSascha Hauer2021-06-251-1/+1
| | | | | | | | | | | of_unflatten_dtb() doesn't check the size of the device tree blob passed to it. Add a size argument end add checks for the size. Some callers have no idea of the buffer size themselves, INT_MAX is passed in these cases. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210624085223.14616-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: replace strerror(-PTR_ERR(errno)) with %pe format specifierAhmad Fatoum2020-09-291-2/+1
| | | | | | | | | Using %pe instead of PTR_ERR has the benefit of being less verbose and less error-prone (no negation necessary) while potentially reducing code size. Make use of it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: fix typos found with codespellYegor Yefremov2020-03-231-1/+1
| | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: treat state with all-invalid buckets as dirtyAhmad Fatoum2020-03-091-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state.dirty flag controls whether state_save will actually persist state. It is cleared when we successfully load or save state and set on writing a state parameter. When the state however becomes corrupt during barebox runtime and state.dirty == 0, reinitializing the state to defaults is quite cumbersome: 1. We reset twice. After the first reset, the dirty flag is reset and before the second, state_save will reinitialize to defaults 2. We write any state variable and then run the state -s command Both workarounds are quite obscure, improve the user experience by having state -l set the dirty flag when it fails, so a subsequent state -s may persist the default values to state. Steps to reproduce: barebox$ state -l state: Using bucket 0@0x00000000 barebox$ memcpy -s /dev/zero -d /dev/eeprom0.state 0 0 0x400 barebox$ state -s barebox$ state -l ERROR: state: No meta data header found ERROR: state: No meta data header found ERROR: state: No meta data header found ERROR: state: Failed to find any valid state copy in any bucket ERROR: state: Failed to read state with format raw, -2 state: No such file or directory Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: backend_storage: deal gracefully with runtime bucket corruptionAhmad Fatoum2020-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrupting an already selected bucket and then reading it again will crash barebox when it attempts the refresh: barebox$ state -l barebox$ mw -d /dev/eeprom0.state 0 0x42 barebox$ state -l ERROR: state: No meta data header found state: Using bucket 1@0x00000040 unable to handle NULL pointer dereference at address 0x00000000 pc : [<4fe4f1ea>] lr : [<4fe0bcb1>] sp : 4ffefd5c ip : 00000000 fp : 2ff68f04 r10: 4ffefdc8 r9 : 4b434d63 r8 : 30155f50 r7 : 00000024 r6 : 2ff68b60 r5 : 2ff68e90 r4 : 00000000 r3 : 00000024 r2 : 00000024 r1 : 30155f50 r0 : 00000000 Flags: Nzcv IRQs off FIQs off Mode SVC_32 WARNING: [<4fe4f1ea>] (memcmp+0x14/0x1a) from [<4fe0bcb1>] (bucket_refresh.isra.0+0x4d/0x78) WARNING: [<4fe0bcb1>] (bucket_refresh.isra.0+0x4d/0x78) from [<4fe0be1d>] (state_storage_read+0xd1/0x104) WARNING: [<4fe0be1d>] (state_storage_read+0xd1/0x104) from [<4fe0a5bd>] (state_do_load+0x1d/0x78) WARNING: [<4fe0a5bd>] (state_do_load+0x1d/0x78) from [<4fe04137>] (execute_command+0x23/0x4c) The memcmp called here is an optimization to skip I/O if the used bucket and the one to be refreshed compare equal. Unfortunately, if the now corrupt bucket was previously the used one, bucket->len will hold the old value and we'll run into a NULL pointer dereference. While this is quite inconvenient, it appears it doesn't affect correctness: after the reset, the corrupt bucket will be refreshed as expected. Improve upon this by setting the length to zero when we are NULLing the buffer. The zero length of the corrupted bucket will then compare unequal to used_bucket->len in bucket_refresh() and ensure we will always refresh the buffer if it becomes corrupted without an intermittent reset. Fixes: 238008b4bd8f ("state: Drop cache bucket") Cc: Enrico Jörns <ejo@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: remove param member from state_uint32, state_enum32, state_macChristian Eggers2020-01-272-11/+8
| | | | | | | After adding the parameter, the pointer isn't required anymore. Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: remove param member from struct state_stringChristian Eggers2020-01-272-4/+4
| | | | | | | After adding the parameter, the pointer isn't required anymore. Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: fix backward compatibilityUlrich Ölmann2019-10-141-3/+0
| | | | | | | | | | | This reverts [1] as it annihilated its counterpart of commit [2]. [1] 5033b4f58f71 ("common: state: harmonize code with dt-utils") [2] 480cde1b2283 ("state: keep backward compatibility") Fixes: 5033b4f58f71 ("common: state: harmonize code with dt-utils") Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: backend_bucket_circular: fix double free()Ulrich Ölmann2019-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | This ports the following dt-utils commit (as the actual code that is changed is removed by the preprocesser when compiling barebox this patch is only of cosmetic nature to keep both code bases in sync): | commit 634317cc91202304c1477a6d738d7c7691b80419 | Author: Kim Christensen <kch@skov.dk> | Date: Wed Sep 18 16:48:23 2019 +0200 | | state: backend_bucket_circular: fix double free() | | The function state_mtd_peb_read() is only a user of buf and not its owner, | hence it may not deallocate it. | | Signed-off-by: Kim Christensen <kch@skov.dk> | Reviewed-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: backend_bucket_circular: harmonize code with dt-utilsUlrich Ölmann2019-10-141-1/+2
| | | | | | | | | | | | | | Comparing barebox' commit [1] with dt-utils' commit [2] it is obvious that adjusting the return value has been forgotten in barebox - fix that. (As the actual code that is changed is removed by the preprocesser when compiling barebox this patch is only of cosmetic nature to keep both code bases in sync). [1] 9d6d91931afb ("state: Remove -EUCLEAN check from userspace tool") [2] 791a2404116d ("state: Remove -EUCLEAN check from userspace tool") Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: drop unused code and declarations for non-existing functionsUwe Kleine-König2019-10-141-7/+0
| | | | | | | | | state_get_name() is not used and so can be removed. state_backend_dtb_file() and state_backend_raw_file() were dropped in c999b507da98 ("state: Refactor state framework"). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: peb: Do not mark as bad in mtd_peb_torture()Sascha Hauer2019-07-161-0/+2
| | | | | | | | | | | Both the Kernel and mtd-utils have peb torture functions and both do not mark the block as bad automatically. Instead, the caller must mark the block as bad when -EIO is returned from the torture function. Do the same in barebox. This is necessary as the UBI code otherwise may mark a block as bad twice: Once indirectly in mtd_peb_torture() and then directly afterwards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: check lengthJan Remmet2019-05-231-1/+6
| | | | | | | | | | | if written_length is read from a partial written bucket it may be to big and xmalloc will panic barebox. Check if the value is sane. Make read_len unsigned to avoid negative values. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Fix lseek error check in state_mtd_peb_write()Andrey Smirnov2019-03-111-4/+3
| | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Fix lseek error check in state_mtd_peb_read()Andrey Smirnov2019-03-111-4/+3
| | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Fix lseek error check in state_backend_bucket_direct_write()Andrey Smirnov2019-03-111-4/+3
| | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Fix lseek error check in state_backend_bucket_direct_read()Andrey Smirnov2019-03-111-8/+8
| | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Insert a helpful size check that is an outcome of the following dt-utils commits: | commit a6eb5350be0f7a5673162d20f2dd72569d5a4d0c | Author: Markus Pargmann <mpa@pengutronix.de> | Date: Fri May 27 13:53:40 2016 +0200 | | barebox-state: Import updated state code | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> | commit 583acea6669550ffa7ffb465301ddb3529206afc | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 23 11:29:50 2017 +0100 | | state: backend-direct: Fix max_size | | The max_size in the direct backend includes the meta data, so | substract its size when determing the max data size we can store. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | commit dcf781f1b3d15aff5f5ff0b604bff447dee2040c | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 23 12:59:48 2017 +0100 | | state: backend_bucket_direct: max_size is always given | | max_size is always != 0, so if(direct->max_size) can be skipped. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-1/+1
| | | | | | | | | | | | | | Linux userspace with recent glibc versions lets barebox-state suffer from linux/stat.h redefining 'struct statx' and because of that switched to the inclusion of sys/stat.h instead, see dt-utils commit 1c80e31872ae ("src: fix compilation for glibc version 2.27.9000-36.fc29 and newer"). We can follow this switch in barebox without any problems, too, as in barebox sys/stat.h includes linux/stat.h (and adds some more definitions on top that don't hurt us here). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-0/+4
| | | | | | | Linux userspace needs sys/param.h to have the definition of roundup(). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-2/+8
| | | | | | | | | Other than in barebox the offset and size of a state's backend device do not necessarily equal zero in Linux userspace (EEPROMs & block devices), so barebox' and dt-utils' state code differ here. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: fix formatting of "uint32_t" variablesUlrich Ölmann2019-02-111-3/+3
| | | | | | | | | | | | | | | | | | | To harmonize the common codebase this ports the following dt-utils commit: | commit 5588a6c32d54bc4a1ef0b9f72807c46dd00bc20e | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Sun Feb 3 22:48:07 2019 +0100 | | state: fix formatting of "uint32_t" variables | | The format specifier "%zd" is for "size_t" typed variables and produces a | warning with gcc, so use "%u" instead. | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: fix formatting of "off_t" variablesUlrich Ölmann2019-02-112-26/+26
| | | | | | | | | | | | | | | | | | | | To harmonize the common codebase this ports the following dt-utils commit: | commit 89d033284cb69f834c1f2195c9e99a3d7f585cf1 | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Sun Feb 3 22:48:06 2019 +0100 | | state: fix formatting of "off_t" variables | | Explicitely casting an "off_t" variable to "long long" and formatting it via | "%lld" or "%llx" respectively makes 32- as well as 64-bit compilers | happy (tested with gcc-8.2.1 and clang-7.0.1). | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: fix compiler warnings about wrong type conversion in messagesUlrich Ölmann2019-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | | To harmonize the common codebase this ports the remaining hunks of the following dt-utils commit, as the residual hunks have independently already been done before in barebox commit 1afbf6b5680e ("state: fix compile warnings for dev_err expansion"): | commit 9f1db73234b40f4ea071421e8179065df16211ec | Author: Philipp Rosenberger <p.rosenberger@linutronix.de> | Date: Thu Oct 18 09:17:23 2018 +0200 | | Fix compiler warnings about wrong type conversion in messages. | | These warning were observed with gcc-6.3 on x86-64. | | Signed-off-by: Philipp Rosenberger <p.rosenberger@linutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: fix typoUlrich Ölmann2019-02-073-4/+4
| | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: fix another alignmentRoland Hieber2019-01-081-1/+1
| | | | | | | Fixes: 7126dffd0be ("common: state: Add variable_type to state_variable") Fixes: 6096a0cfa4a ("common: state: fix alignment") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: fix alignmentRoland Hieber2019-01-071-4/+4
| | | | | | Fixes: 7126dffd0be ("common: state: Add variable_type to state_variable") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: remove unused functionSascha Hauer2018-11-191-13/+0
| | | | | | state_find_type() is unused and doesn't have a prototype. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2018-11-092-7/+8
|\
| * state: backend_bucket_circular: remove unused variablesUlrich Ölmann2018-10-121-2/+0
| | | | | | | | | | | | | | | | This has been forgotten in commit 9d6d91931afb ("state: Remove -EUCLEAN check from userspace tool"). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: fix typoUlrich Ölmann2018-10-101-1/+1
| | | | | | | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_bucket_circular: fix memory leakUlrich Ölmann2018-10-101-4/+7
| | | | | | | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net-switch-mv88e6xxx'Sascha Hauer2018-11-091-1/+1
|\ \
| * | drivers: Introduce dev_set_name()Andrey Smirnov2018-10-181-1/+1
| |/ | | | | | | | | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | state: fix indentationUlrich Ölmann2018-10-191-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | state: fix documentation of state_new_from_node()Ulrich Ölmann2018-10-121-0/+1
| | | | | | | | | | | | | | | | Commit a66a8d79871c ("state: remove unused arguments from state_new_from_node()") removed a little bit too much. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common: state: use of_property_write_string() where appropriateUlrich Ölmann2018-10-121-4/+2
|/ | | | | | | | See commit b6089182316d ("treewide: Use of_property_write_string() where appropriate"). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: backend_bucket_circular: fix for non power of 2 writesizeLadislav Michl2018-09-261-2/+2
| | | | | | | | | backend_bucket_circular currently assumes writesize is power of 2, which makes it fail on dataflash devices, where this assumption is false. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: Add property to protect existing dataDaniel Schultz2018-04-164-4/+27
| | | | | | | | | | | After an update to a newer barebox version with an enabled state framework, existing data in storage memories could be overwritten. Add a new property to check in front of every write task, if the meta magic field only contains the magic number, zeros or ones. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: find backend node with its reproducible nameSascha Hauer2018-02-222-1/+6
| | | | | | | | | | | | When fixing up the kernels state nodes we depended on the full node path of the input device tree. This does not work when the kernel device tree has different names. This has happened lately when the i.MX6 device trees got their leading zeroes removed from the node names. Use of_find_node_by_reproducible_name() to find the node corresponding to the storage backend node in the kernel device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: remove unused arguments from state_new_from_node()Sascha Hauer2018-02-221-28/+16
| | | | | | | | state_new_from_node() has arguments describing the backend path. These are never used in barebox, the backend path is always derived from the device nodes backend description. Remove these arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Add 'init_from_defaults' parameterSascha Hauer2018-02-062-0/+9
| | | | | | | The init_from_defaults parameter allows to detect if a state has been initialized from default values, i.e. state_load failed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: refuse to set dirty parameter via setenvSascha Hauer2018-02-061-1/+6
| | | | | | The dirty parameter is readonly, so refuse to set it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: Add function to read state MACDaniel Schultz2017-11-071-0/+21
| | | | | | | | This API function allows to receive a copy of a MAC address from variables in a state. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: Add variable type as enumDaniel Schultz2017-11-072-0/+27
| | | | | | | | | | | The variable_type struct holds a name of its type. Checking the type of a variable with this string needs much resources. This patch introduce a enum of the variable type for better type checking. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: state: Add variable_type to state_variableDaniel Schultz2017-11-073-9/+21
| | | | | | | | Add a pointer in state_variable to the corresponding variable_type array element. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove checks for xzalloc() returning NULLUwe Kleine-König2017-09-263-8/+0
| | | | | | | xzalloc() either returns memory or panics, so checking for NULL is useless. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: don't use uninitialized variableJuergen Borleis2017-09-061-1/+1
| | | | | | | Printing 'ret' makes no sense. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: use the given backend storage type nameJuergen Borleis2017-09-061-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change 119f92b27e131a0cb506fe8d8bffe8010fb14a3d already tried to fix it, but forgets the 'direct' usecase. The 'backend-storage-type' node is optional. Its default depends on the capability of the used backend memory, which means "circular" or NULL. The latter defaults to 'direct' in the routines. If it is NULL, the devicetree fixup routine skips exporting a 'backend-storage-type' node to the kernel's devicetree. But currently if the 'backend-storage-type' node is explicitly given as 'direct', it will be skipped silently and set to NULL instead. In this case the user of the 'barebox-state' tool then ends up with the warning: "No backend-storage-type found, using default" which is annoying, because it was given. Storing the given value will still use a NULL if the 'backend-storage-type' node isn't defined, but stores everything else if it is defined. Then the 'backend-storage-type' node is present in the kernel's devicetree as well. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: provide an error message when an error occursJuergen Borleis2017-09-061-0/+1
| | | | | | | | A simple typo makes the state framework fail, but without an error message the developer is lost in the dark. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>