
Dear Simon Glass,
In message 1332965305-21151-1-git-send-email-sjg@chromium.org you wrote:
CONFIG_OF_CONTROL requires a valid device tree. However, we cannot call panic() before the console is set up since the message does not appear, and we get a silent failure.
...
+int fdtdec_prepare_fdt(void);
+/**
- Checks that we have a valid fdt available to control U-Boot.
- However, if not then for the moment nothing is done, since this function
- is called too early to panic().
- @returns 0
If the function always returns 0, then it makes no sense to return any value at all. Please make it void, then.
+int fdtdec_check_fdt(void) +{
- /*
* We must have an FDT, but we cannot panic() yet since the console
* is not ready. So for now, just assert(). Boards which need an early
* FDT (prior to console ready) will need to make their own
* arrangements and do their own checks.
*/
- assert(!fdtdec_prepare_fdt());
- return 0;
+}
Ditto - make that "void fdtdec_check_fdt(void)".
+int fdtdec_prepare_fdt(void)
...
return 0; }
Ditto - make that "void fdtdec_prepare_fdt(void)".
I have to admit that I do not understand how this patch will help you anything. You write "we cannot panic()", but "just assert()".
If the assertion fails, it will call __assert_fail() - which in turn will just call panic(). So you are out of the frying pan into the fire.
Best regards,
Wolfgang Denk