sf: Add debug messages on spi_flash_read_common
authorJagannadha Sutradharudu Teki <jagannadha.sutradharudu-teki@xilinx.com>
Fri, 21 Jun 2013 13:49:02 +0000 (19:19 +0530)
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Sun, 23 Jun 2013 16:40:36 +0000 (22:10 +0530)
- Added debug's on spi_flash_read_common()
- Added space

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
drivers/mtd/spi/spi_flash.c

index a329850..51142d8 100644 (file)
@@ -254,8 +254,18 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
        struct spi_slave *spi = flash->spi;
        int ret;
 
-       spi_claim_bus(spi);
+       ret = spi_claim_bus(flash->spi);
+       if (ret) {
+               debug("SF: unable to claim SPI bus\n");
+               return ret;
+       }
+
        ret = spi_flash_cmd_read(spi, cmd, cmd_len, data, data_len);
+       if (ret < 0) {
+               debug("SF: read cmd failed\n");
+               return ret;
+       }
+
        spi_release_bus(spi);
 
        return ret;