diff options
author | Huang Shijie <b32955@freescale.com> | 2012-07-17 02:14:02 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 09:59:12 -0400 |
commit | 513d57e1db53870cdc11e60df77c57c8b3897fdf (patch) | |
tree | 06fcf3c8370cba8c83b9902602b132432b071a0e /drivers | |
parent | cdeadd712f52b16a9285386d61ee26fd14eb4085 (diff) |
mtd: gpmi: fix the compiler warnings
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 20 | ||||
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.h | 4 |
3 files changed, 12 insertions, 16 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c index 6bb0998dcb40..2289cf8dc35b 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "gpmi-regs.h" | 26 | #include "gpmi-regs.h" |
27 | #include "bch-regs.h" | 27 | #include "bch-regs.h" |
28 | 28 | ||
29 | struct timing_threshod timing_default_threshold = { | 29 | static struct timing_threshod timing_default_threshold = { |
30 | .max_data_setup_cycles = (BM_GPMI_TIMING0_DATA_SETUP >> | 30 | .max_data_setup_cycles = (BM_GPMI_TIMING0_DATA_SETUP >> |
31 | BP_GPMI_TIMING0_DATA_SETUP), | 31 | BP_GPMI_TIMING0_DATA_SETUP), |
32 | .internal_data_setup_in_ns = 0, | 32 | .internal_data_setup_in_ns = 0, |
@@ -738,7 +738,7 @@ void gpmi_begin(struct gpmi_nand_data *this) | |||
738 | { | 738 | { |
739 | struct resources *r = &this->resources; | 739 | struct resources *r = &this->resources; |
740 | struct timing_threshod *nfc = &timing_default_threshold; | 740 | struct timing_threshod *nfc = &timing_default_threshold; |
741 | unsigned char *gpmi_regs = r->gpmi_regs; | 741 | void __iomem *gpmi_regs = r->gpmi_regs; |
742 | unsigned int clock_period_in_ns; | 742 | unsigned int clock_period_in_ns; |
743 | uint32_t reg; | 743 | uint32_t reg; |
744 | unsigned int dll_wait_time_in_us; | 744 | unsigned int dll_wait_time_in_us; |
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 8c0d2f0a526f..c46be6c8b2c4 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -317,7 +317,7 @@ acquire_register_block(struct gpmi_nand_data *this, const char *res_name) | |||
317 | struct platform_device *pdev = this->pdev; | 317 | struct platform_device *pdev = this->pdev; |
318 | struct resources *res = &this->resources; | 318 | struct resources *res = &this->resources; |
319 | struct resource *r; | 319 | struct resource *r; |
320 | void *p; | 320 | void __iomem *p; |
321 | 321 | ||
322 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name); | 322 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name); |
323 | if (!r) { | 323 | if (!r) { |
@@ -424,8 +424,8 @@ static int __devinit acquire_dma_channels(struct gpmi_nand_data *this) | |||
424 | struct platform_device *pdev = this->pdev; | 424 | struct platform_device *pdev = this->pdev; |
425 | struct resource *r_dma; | 425 | struct resource *r_dma; |
426 | struct device_node *dn; | 426 | struct device_node *dn; |
427 | int dma_channel; | 427 | u32 dma_channel; |
428 | unsigned int ret; | 428 | int ret; |
429 | struct dma_chan *dma_chan; | 429 | struct dma_chan *dma_chan; |
430 | dma_cap_mask_t mask; | 430 | dma_cap_mask_t mask; |
431 | 431 | ||
@@ -732,12 +732,12 @@ static int gpmi_alloc_dma_buffer(struct gpmi_nand_data *this) | |||
732 | struct device *dev = this->dev; | 732 | struct device *dev = this->dev; |
733 | 733 | ||
734 | /* [1] Allocate a command buffer. PAGE_SIZE is enough. */ | 734 | /* [1] Allocate a command buffer. PAGE_SIZE is enough. */ |
735 | this->cmd_buffer = kzalloc(PAGE_SIZE, GFP_DMA); | 735 | this->cmd_buffer = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL); |
736 | if (this->cmd_buffer == NULL) | 736 | if (this->cmd_buffer == NULL) |
737 | goto error_alloc; | 737 | goto error_alloc; |
738 | 738 | ||
739 | /* [2] Allocate a read/write data buffer. PAGE_SIZE is enough. */ | 739 | /* [2] Allocate a read/write data buffer. PAGE_SIZE is enough. */ |
740 | this->data_buffer_dma = kzalloc(PAGE_SIZE, GFP_DMA); | 740 | this->data_buffer_dma = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL); |
741 | if (this->data_buffer_dma == NULL) | 741 | if (this->data_buffer_dma == NULL) |
742 | goto error_alloc; | 742 | goto error_alloc; |
743 | 743 | ||
@@ -1260,7 +1260,6 @@ static int mx23_check_transcription_stamp(struct gpmi_nand_data *this) | |||
1260 | unsigned int search_area_size_in_strides; | 1260 | unsigned int search_area_size_in_strides; |
1261 | unsigned int stride; | 1261 | unsigned int stride; |
1262 | unsigned int page; | 1262 | unsigned int page; |
1263 | loff_t byte; | ||
1264 | uint8_t *buffer = chip->buffers->databuf; | 1263 | uint8_t *buffer = chip->buffers->databuf; |
1265 | int saved_chip_number; | 1264 | int saved_chip_number; |
1266 | int found_an_ncb_fingerprint = false; | 1265 | int found_an_ncb_fingerprint = false; |
@@ -1277,9 +1276,8 @@ static int mx23_check_transcription_stamp(struct gpmi_nand_data *this) | |||
1277 | dev_dbg(dev, "Scanning for an NCB fingerprint...\n"); | 1276 | dev_dbg(dev, "Scanning for an NCB fingerprint...\n"); |
1278 | 1277 | ||
1279 | for (stride = 0; stride < search_area_size_in_strides; stride++) { | 1278 | for (stride = 0; stride < search_area_size_in_strides; stride++) { |
1280 | /* Compute the page and byte addresses. */ | 1279 | /* Compute the page addresses. */ |
1281 | page = stride * rom_geo->stride_size_in_pages; | 1280 | page = stride * rom_geo->stride_size_in_pages; |
1282 | byte = page * mtd->writesize; | ||
1283 | 1281 | ||
1284 | dev_dbg(dev, "Looking for a fingerprint in page 0x%x\n", page); | 1282 | dev_dbg(dev, "Looking for a fingerprint in page 0x%x\n", page); |
1285 | 1283 | ||
@@ -1321,7 +1319,6 @@ static int mx23_write_transcription_stamp(struct gpmi_nand_data *this) | |||
1321 | unsigned int block; | 1319 | unsigned int block; |
1322 | unsigned int stride; | 1320 | unsigned int stride; |
1323 | unsigned int page; | 1321 | unsigned int page; |
1324 | loff_t byte; | ||
1325 | uint8_t *buffer = chip->buffers->databuf; | 1322 | uint8_t *buffer = chip->buffers->databuf; |
1326 | int saved_chip_number; | 1323 | int saved_chip_number; |
1327 | int status; | 1324 | int status; |
@@ -1370,9 +1367,8 @@ static int mx23_write_transcription_stamp(struct gpmi_nand_data *this) | |||
1370 | /* Loop through the first search area, writing NCB fingerprints. */ | 1367 | /* Loop through the first search area, writing NCB fingerprints. */ |
1371 | dev_dbg(dev, "Writing NCB fingerprints...\n"); | 1368 | dev_dbg(dev, "Writing NCB fingerprints...\n"); |
1372 | for (stride = 0; stride < search_area_size_in_strides; stride++) { | 1369 | for (stride = 0; stride < search_area_size_in_strides; stride++) { |
1373 | /* Compute the page and byte addresses. */ | 1370 | /* Compute the page addresses. */ |
1374 | page = stride * rom_geo->stride_size_in_pages; | 1371 | page = stride * rom_geo->stride_size_in_pages; |
1375 | byte = page * mtd->writesize; | ||
1376 | 1372 | ||
1377 | /* Write the first page of the current stride. */ | 1373 | /* Write the first page of the current stride. */ |
1378 | dev_dbg(dev, "Writing an NCB fingerprint in page 0x%x\n", page); | 1374 | dev_dbg(dev, "Writing an NCB fingerprint in page 0x%x\n", page); |
@@ -1527,7 +1523,7 @@ static int gpmi_scan_bbt(struct mtd_info *mtd) | |||
1527 | return nand_default_bbt(mtd); | 1523 | return nand_default_bbt(mtd); |
1528 | } | 1524 | } |
1529 | 1525 | ||
1530 | void gpmi_nfc_exit(struct gpmi_nand_data *this) | 1526 | static void gpmi_nfc_exit(struct gpmi_nand_data *this) |
1531 | { | 1527 | { |
1532 | nand_release(&this->mtd); | 1528 | nand_release(&this->mtd); |
1533 | gpmi_free_dma_buffer(this); | 1529 | gpmi_free_dma_buffer(this); |
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h index 1547a60c1c6f..1f6121782330 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */ | 25 | #define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */ |
26 | struct resources { | 26 | struct resources { |
27 | void *gpmi_regs; | 27 | void __iomem *gpmi_regs; |
28 | void *bch_regs; | 28 | void __iomem *bch_regs; |
29 | unsigned int bch_low_interrupt; | 29 | unsigned int bch_low_interrupt; |
30 | unsigned int bch_high_interrupt; | 30 | unsigned int bch_high_interrupt; |
31 | unsigned int dma_low_channel; | 31 | unsigned int dma_low_channel; |