mtd: pxa3xx_nand: Simplify pxa3xx_nand_scan
This commit simplifies the initial configuration performed by pxa3xx_nand_scan. No functionality change is intended. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:

committed by
Brian Norris

parent
66e8e47eae
commit
154f50fbde
@@ -1413,7 +1413,7 @@ static void pxa3xx_nand_config_tail(struct pxa3xx_nand_info *info)
|
|||||||
info->reg_ndcr |= (mtd->writesize == 2048) ? NDCR_PAGE_SZ : 0;
|
info->reg_ndcr |= (mtd->writesize == 2048) ? NDCR_PAGE_SZ : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info)
|
static void pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = info->pdev;
|
struct platform_device *pdev = info->pdev;
|
||||||
struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
|
struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
|
||||||
@@ -1426,7 +1426,6 @@ static int pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info)
|
|||||||
info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
|
info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
|
||||||
info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
|
info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
|
||||||
info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
|
info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pxa3xx_nand_init_buff(struct pxa3xx_nand_info *info)
|
static int pxa3xx_nand_init_buff(struct pxa3xx_nand_info *info)
|
||||||
@@ -1597,22 +1596,21 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
|
|||||||
int ret;
|
int ret;
|
||||||
uint16_t ecc_strength, ecc_step;
|
uint16_t ecc_strength, ecc_step;
|
||||||
|
|
||||||
if (pdata->keep_config && !pxa3xx_nand_detect_config(info))
|
if (pdata->keep_config) {
|
||||||
goto KEEP_CONFIG;
|
pxa3xx_nand_detect_config(info);
|
||||||
|
} else {
|
||||||
ret = pxa3xx_nand_config_ident(info);
|
ret = pxa3xx_nand_config_ident(info);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
ret = pxa3xx_nand_sensing(host);
|
||||||
ret = pxa3xx_nand_sensing(host);
|
if (ret) {
|
||||||
if (ret) {
|
dev_info(&info->pdev->dev,
|
||||||
dev_info(&info->pdev->dev, "There is no chip on cs %d!\n",
|
"There is no chip on cs %d!\n",
|
||||||
info->cs);
|
info->cs);
|
||||||
|
return ret;
|
||||||
return ret;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KEEP_CONFIG:
|
|
||||||
if (info->reg_ndcr & NDCR_DWIDTH_M)
|
if (info->reg_ndcr & NDCR_DWIDTH_M)
|
||||||
chip->options |= NAND_BUSWIDTH_16;
|
chip->options |= NAND_BUSWIDTH_16;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user