[U-Boot] [PATCH 01/11] fdt: Allow ft_board_setup() to report failure

Simon Glass sjg at chromium.org
Fri Oct 24 02:59:21 CEST 2014


Hi,

On 20 October 2014 19:51, Simon Glass <sjg at chromium.org> wrote:
> Hi Anatolij,
>
> On 17 October 2014 14:19, Anatolij Gustschin <agust at denx.de> wrote:
>> Hi Simon,
>>
>> some comments on return values and error reporting below:
>>
>> On Wed, 15 Oct 2014 02:05:31 -0600
>> Simon Glass <sjg at chromium.org> wrote:
>> ...
>>> diff --git a/board/amcc/sequoia/sequoia.c b/board/amcc/sequoia/sequoia.c
>>> index 53f9b34..afac3f9 100644
>>> --- a/board/amcc/sequoia/sequoia.c
>>> +++ b/board/amcc/sequoia/sequoia.c
>>> @@ -10,6 +10,7 @@
>>>   */
>>>
>>>  #include <common.h>
>>> +#include <errno.h>
>>>  #include <libfdt.h>
>>>  #include <fdt_support.h>
>>>  #include <asm/ppc4xx.h>
>>> @@ -363,7 +364,7 @@ void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
>>>   * On NAND-booting sequoia, we need to patch the chips select numbers
>>>   * in the dtb (CS0 - NAND, CS3 - NOR)
>>>   */
>>> -void ft_board_setup(void *blob, bd_t *bd)
>>> +int ft_board_setup(void *blob, bd_t *bd)
>>>  {
>>>       int rc;
>>>       int len;
>>> @@ -381,7 +382,7 @@ void ft_board_setup(void *blob, bd_t *bd)
>>>       prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
>>>       if (prop == NULL) {
>>>               printf("Unable to update NOR chip select for NAND booting\n");
>>> -             return;
>>> +             return -ENOSPC;
>>
>> return -FDT_ERR_NOSPACE;
>>
>> otherwise failure reporting of ft_board_setup() as added in the next
>> patch will output "<unknown error>".
>
> OK so I think you are saying that this should return an FDT error
> rather than a U-Boot error. This is a much better idea, I will change
> it throughout.

Er, actually it looks like I had the same thought at the time and even
added a nice comment to the function. Then I didn't follow
through...will fix.

Regards,
Simon


More information about the U-Boot mailing list