Commit 862887d8836643e316cd019b93b1732971c8aaf8

Authored by Simon Glass
Committed by Tom Warren
1 parent 00e9e6d1ff

errno: Allow errno_str() to be used without CONFIG_ERRNO_STR

The pmic framework uses errno_str() and this requires board that use it to
enable CONFIG_ERRNO_STR to avoid a build error. Update the header to provide
a NULL error message when CONFIG_ERRNO_STR is not defined, and fix the build
error.

This will show as "(null)" when U-Boot prints it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

... ... @@ -15,6 +15,11 @@
15 15  
16 16 #ifdef CONFIG_ERRNO_STR
17 17 const char *errno_str(int errno);
  18 +#else
  19 +static inline const char *errno_str(int errno)
  20 +{
  21 + return 0;
  22 +}
18 23 #endif
19 24 #endif /* _ERRNO_H */