Commit 3ba8d416 authored by Felipe Balbi's avatar Felipe Balbi Committed by Kevin Hilman

mtd: nand: davinci: checkpatch.pl fixes

checkpatch.pl fixes to davinci_nand.c
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
parent f60b03b4
...@@ -162,7 +162,7 @@ static int nand_davinci_calculate_ecc(struct mtd_info *mtd, ...@@ -162,7 +162,7 @@ static int nand_davinci_calculate_ecc(struct mtd_info *mtd,
{ {
unsigned int ecc_val = nand_davinci_readecc(mtd); unsigned int ecc_val = nand_davinci_readecc(mtd);
/* squeeze 0 middle bits out so that it fits in 3 bytes */ /* squeeze 0 middle bits out so that it fits in 3 bytes */
unsigned int tmp = (ecc_val&0x0fff)|((ecc_val&0x0fff0000)>>4); unsigned int tmp = (ecc_val & 0x0fff) | ((ecc_val & 0x0fff0000) >> 4);
/* invert so that erased block ecc is correct */ /* invert so that erased block ecc is correct */
tmp = ~tmp; tmp = ~tmp;
ecc_code[0] = (u_char)(tmp); ecc_code[0] = (u_char)(tmp);
...@@ -183,15 +183,15 @@ static int nand_davinci_correct_data(struct mtd_info *mtd, u_char *dat, ...@@ -183,15 +183,15 @@ static int nand_davinci_correct_data(struct mtd_info *mtd, u_char *dat,
u_int32_t diff = eccCalc ^ eccNand; u_int32_t diff = eccCalc ^ eccNand;
if (diff) { if (diff) {
if ((((diff>>12)^diff) & 0xfff) == 0xfff) { if ((((diff >> 12) ^ diff) & 0xfff) == 0xfff) {
/* Correctable error */ /* Correctable error */
if ((diff>>(12+3)) < chip->ecc.size) { if ((diff >> (12 + 3)) < chip->ecc.size) {
dat[diff>>(12+3)] ^= (1 << ((diff>>12)&7)); dat[diff >> (12 + 3)] ^= (1 << ((diff >> 12) & 7));
return 1; return 1;
} else { } else {
return -1; return -1;
} }
} else if (!(diff & (diff-1))) { } else if (!(diff & (diff - 1))) {
/* Single bit ECC error in the ECC itself, /* Single bit ECC error in the ECC itself,
nothing to fix */ nothing to fix */
return 1; return 1;
...@@ -360,7 +360,7 @@ static void nand_davinci_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) ...@@ -360,7 +360,7 @@ static void nand_davinci_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
*/ */
static int nand_davinci_dev_ready(struct mtd_info *mtd) static int nand_davinci_dev_ready(struct mtd_info *mtd)
{ {
return (davinci_nand_readl(NANDFSR_OFFSET) & NAND_BUSY_FLAG); return davinci_nand_readl(NANDFSR_OFFSET) & NAND_BUSY_FLAG;
} }
static void nand_davinci_set_eccsize(struct nand_chip *chip) static void nand_davinci_set_eccsize(struct nand_chip *chip)
...@@ -477,7 +477,8 @@ int __devinit nand_davinci_probe(struct platform_device *pdev) ...@@ -477,7 +477,8 @@ int __devinit nand_davinci_probe(struct platform_device *pdev)
{ {
struct flash_platform_data *pdata = pdev->dev.platform_data; struct flash_platform_data *pdata = pdev->dev.platform_data;
struct resource *res = pdev->resource; struct resource *res = pdev->resource;
struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); struct resource *res2 = platform_get_resource(pdev,
IORESOURCE_MEM, 1);
struct nand_chip *chip; struct nand_chip *chip;
struct device *dev = NULL; struct device *dev = NULL;
u32 nand_rev_code; u32 nand_rev_code;
...@@ -629,16 +630,13 @@ static int __init nand_davinci_init(void) ...@@ -629,16 +630,13 @@ static int __init nand_davinci_init(void)
} }
module_init(nand_davinci_init); module_init(nand_davinci_init);
#ifdef MODULE
static void __exit nand_davinci_exit(void) static void __exit nand_davinci_exit(void)
{ {
platform_driver_unregister(&nand_davinci_driver); platform_driver_unregister(&nand_davinci_driver);
} }
module_exit(nand_davinci_exit); module_exit(nand_davinci_exit);
#endif
MODULE_ALIAS(DRIVER_NAME); MODULE_ALIAS(DRIVER_NAME);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Texas Instruments"); MODULE_AUTHOR("Texas Instruments");
MODULE_DESCRIPTION("Board-specific glue layer for NAND flash on davinci" \ MODULE_DESCRIPTION("Davinci NAND flash driver");
"board");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment