Skip to content
Snippets Groups Projects
  • Heinrich Schuchardt's avatar
    ca9d9263
    boot: fix bootdev_list() · ca9d9263
    Heinrich Schuchardt authored and Simon Glass's avatar Simon Glass committed
    
    uclass_get_device_by_name() is meant to return 0 or a negative error code.
    simple_itoa() cannot handle negative numbers.
    
    This leads to output like:
    
        => bootdev list -p
    
        Seq  Probed  Status  Uclass    Name
        ---  ------  ------  --------  ------------------
          c   [   ]  18446744073709551614  spi_flash spi.bin@0.bootdev
    
    Convert the status to a positive number. Now we get
    
        Seq  Probed  Status  Uclass    Name
        ---  ------  ------  --------  ------------------
          c   [   ]       2  spi_flash spi.bin@0.bootdev
    
    Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
    ca9d9263
    History
    boot: fix bootdev_list()
    Heinrich Schuchardt authored and Simon Glass's avatar Simon Glass committed
    
    uclass_get_device_by_name() is meant to return 0 or a negative error code.
    simple_itoa() cannot handle negative numbers.
    
    This leads to output like:
    
        => bootdev list -p
    
        Seq  Probed  Status  Uclass    Name
        ---  ------  ------  --------  ------------------
          c   [   ]  18446744073709551614  spi_flash spi.bin@0.bootdev
    
    Convert the status to a positive number. Now we get
    
        Seq  Probed  Status  Uclass    Name
        ---  ------  ------  --------  ------------------
          c   [   ]       2  spi_flash spi.bin@0.bootdev
    
    Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>