Commit 469146c0977436c0803590ef6a0de368cab5b946

Authored by Jagannadha Sutradharudu Teki
1 parent 6152dd1528

sf: Minor cleanups.

- 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>

Showing 4 changed files with 14 additions and 13 deletions Side-by-side Diff

drivers/mtd/spi/sf_internal.h
... ... @@ -7,8 +7,8 @@
7 7 * Licensed under the GPL-2 or later.
8 8 */
9 9  
10   -#ifndef _SPI_FLASH_INTERNAL_H_
11   -#define _SPI_FLASH_INTERNAL_H_
  10 +#ifndef _SF_INTERNAL_H_
  11 +#define _SF_INTERNAL_H_
12 12  
13 13 #define SPI_FLASH_16MB_BOUN 0x1000000
14 14  
... ... @@ -139,5 +139,5 @@
139 139 int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
140 140 size_t len, void *data);
141 141  
142   -#endif /* _SPI_FLASH_INTERNAL_H_ */
  142 +#endif /* _SF_INTERNAL_H_ */
drivers/mtd/spi/sf_ops.c
... ... @@ -292,7 +292,7 @@
292 292 return ret;
293 293 }
294 294 #endif
295   - remain_len = (SPI_FLASH_16MB_BOUN * (bank_sel + 1) - offset);
  295 + remain_len = (SPI_FLASH_16MB_BOUN * (bank_sel + 1)) - offset;
296 296 if (len < remain_len)
297 297 read_len = len;
298 298 else
drivers/mtd/spi/sf_probe.c
... ... @@ -25,7 +25,7 @@
25 25 * @jedec: Device jedec ID (0x[1byte_manuf_id][2byte_dev_id])
26 26 * @ext_jedec: Device ext_jedec ID
27 27 * @sector_size: Sector size of this device
28   - * @nr_sectors: No.of sectors on this device
  28 + * @nr_sectors: No.of sectors on this device
29 29 * @flags: Importent param, for flash specific behaviour
30 30 */
31 31 struct spi_flash_params {
... ... @@ -139,7 +139,7 @@
139 139 #endif
140 140 /*
141 141 * Note:
142   - * Below paired flash devices has similar spi_flash_params params.
  142 + * Below paired flash devices has similar spi_flash params.
143 143 * (S25FL129P_64K, S25FL128S_64K)
144 144 * (W25Q80BL, W25Q80BV)
145 145 * (W25Q16CL, W25Q16DV)
... ... @@ -188,6 +188,7 @@
188 188 }
189 189 memset(flash, '\0', sizeof(*flash));
190 190  
  191 + /* Assign spi data */
191 192 flash->spi = spi;
192 193 flash->name = params->name;
193 194 flash->memory_map = spi->memory_map;
1 1 /*
  2 + * Common SPI Interface: Controller-specific definitions
  3 + *
2 4 * (C) Copyright 2001
3 5 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com.
4 6 *
... ... @@ -8,8 +10,6 @@
8 10 #ifndef _SPI_H_
9 11 #define _SPI_H_
10 12  
11   -/* Controller-specific definitions: */
12   -
13 13 /* SPI mode flags */
14 14 #define SPI_CPHA 0x01 /* clock phase */
15 15 #define SPI_CPOL 0x02 /* clock polarity */
... ... @@ -241,11 +241,11 @@
241 241 * This calls spi_setup_slave() with the correct bus number. Call
242 242 * spi_free_slave() to free it later.
243 243 *
244   - * @param blob Device tree blob
245   - * @param node SPI peripheral node to use
246   - * @param cs Chip select to use
247   - * @param max_hz Maximum SCK rate in Hz (0 for default)
248   - * @param mode Clock polarity, clock phase and other parameters
  244 + * @param blob: Device tree blob
  245 + * @param node: SPI peripheral node to use
  246 + * @param cs: Chip select to use
  247 + * @param max_hz: Maximum SCK rate in Hz (0 for default)
  248 + * @param mode: Clock polarity, clock phase and other parameters
249 249 * @return pointer to new spi_slave structure
250 250 */
251 251 struct spi_slave *spi_setup_slave_fdt(const void *blob, int node,