Skip to content
  • Marek Behún's avatar
    mtd: spi-flash: Check for zero length in legacy spi_flash_*() · a67b3719
    Marek Behún authored and Jagan Teki's avatar Jagan Teki committed
    
    
    Check for zero length in the legacy spi_flash_read() /
    spi_flash_write() / spi_flash_erase() functions.
    On zero length, return 0 immediately, don't call the underlying method.
    
    Rationale:
    - these legacy functions call the _read(), _write() and _erase() methods
      of struct mtd
    - the DM callers of these methods already check for zero length
    - making all callers of these methods check for zero length makes it
      possible to remove the check from implementations of these _read(),
      _write() and _erase() methods
    
    Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
    a67b3719