]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sf: Minor cleanups.
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Thu, 10 Oct 2013 16:44:09 +0000 (22:14 +0530)
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Tue, 15 Oct 2013 18:44:00 +0000 (00:14 +0530)
- Add comments.
- Renamed few macros.
- Add tabs.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
drivers/mtd/spi/sf_internal.h
drivers/mtd/spi/sf_ops.c
drivers/mtd/spi/sf_probe.c
include/spi.h

index 12d02f9e4169027b7641c50363bbae6597c4be0e..ad044ee93bf29f879b04d6f46e1651232cdafab1 100644 (file)
@@ -7,8 +7,8 @@
  * Licensed under the GPL-2 or later.
  */
 
-#ifndef _SPI_FLASH_INTERNAL_H_
-#define _SPI_FLASH_INTERNAL_H_
+#ifndef _SF_INTERNAL_H_
+#define _SF_INTERNAL_H_
 
 #define SPI_FLASH_16MB_BOUN            0x1000000
 
@@ -139,4 +139,4 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
 int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
                size_t len, void *data);
 
-#endif /* _SPI_FLASH_INTERNAL_H_ */
+#endif /* _SF_INTERNAL_H_ */
index 10030385c0d236a48e7d86e5081c44cf65a014e7..dde6231c6ce7424bb0e1a7ceb604867a5ac937ab 100644 (file)
@@ -292,7 +292,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
                        return ret;
                }
 #endif
-               remain_len = (SPI_FLASH_16MB_BOUN * (bank_sel + 1) - offset);
+               remain_len = (SPI_FLASH_16MB_BOUN * (bank_sel + 1)) - offset;
                if (len < remain_len)
                        read_len = len;
                else
index 4251b1be192f13bb14e5abbe8db66f397dcc50a3..9bb5a5f13a8ac7d044f043059946e1e63ff01e8b 100644 (file)
@@ -25,7 +25,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * @jedec:             Device jedec ID (0x[1byte_manuf_id][2byte_dev_id])
  * @ext_jedec:         Device ext_jedec ID
  * @sector_size:       Sector size of this device
- * @nr_sectors:        No.of sectors on this device
+ * @nr_sectors:                No.of sectors on this device
  * @flags:             Importent param, for flash specific behaviour
  */
 struct spi_flash_params {
@@ -139,7 +139,7 @@ static const struct spi_flash_params spi_flash_params_table[] = {
 #endif
        /*
         * Note:
-        * Below paired flash devices has similar spi_flash_params params.
+        * Below paired flash devices has similar spi_flash params.
         * (S25FL129P_64K, S25FL128S_64K)
         * (W25Q80BL, W25Q80BV)
         * (W25Q16CL, W25Q16DV)
@@ -188,6 +188,7 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,
        }
        memset(flash, '\0', sizeof(*flash));
 
+       /* Assign spi data */
        flash->spi = spi;
        flash->name = params->name;
        flash->memory_map = spi->memory_map;
index 5164d437b9fd75819f0aca4a9394fd1532c50bdd..ad9248bee02b30d4214baeb418048eef62ca8029 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * Common SPI Interface: Controller-specific definitions
+ *
  * (C) Copyright 2001
  * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com.
  *
@@ -8,8 +10,6 @@
 #ifndef _SPI_H_
 #define _SPI_H_
 
-/* Controller-specific definitions: */
-
 /* SPI mode flags */
 #define        SPI_CPHA        0x01                    /* clock phase */
 #define        SPI_CPOL        0x02                    /* clock polarity */
@@ -241,11 +241,11 @@ static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte)
  * This calls spi_setup_slave() with the correct bus number. Call
  * spi_free_slave() to free it later.
  *
- * @param blob         Device tree blob
- * @param node         SPI peripheral node to use
- * @param cs           Chip select to use
- * @param max_hz       Maximum SCK rate in Hz (0 for default)
- * @param mode         Clock polarity, clock phase and other parameters
+ * @param blob:                Device tree blob
+ * @param node:                SPI peripheral node to use
+ * @param cs:          Chip select to use
+ * @param max_hz:      Maximum SCK rate in Hz (0 for default)
+ * @param mode:                Clock polarity, clock phase and other parameters
  * @return pointer to new spi_slave structure
  */
 struct spi_slave *spi_setup_slave_fdt(const void *blob, int node,