Skip to content
  • Simon Glass's avatar
    dm: Convert spi_flash_probe() and 'sf probe' to use driver model · fbb09918
    Simon Glass authored
    
    
    We want the SPI flash probing feature to operate as a standard driver.
    Add a driver for the basic probing feature used by most boards. This
    will be activated by device_probe() as with any other driver.
    
    The 'sf probe' command currently keeps track of the SPI slave that it
    last used. This doesn't work with driver model, since some other driver
    or system may have probed the device and have access to it too. On the
    other hand, if we try to probe a device twice the second probe is a nop
    with driver model.
    
    Fix this by searching for the matching device, removing it, and then
    probing it again. This should work as expected regardless of other device
    activity.
    
    Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    Reviewed-by: default avatarJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
    fbb09918