[RFC/PATCH] mtd: nand: pxa3xx: Remove redundant device probing
Daniel Mack
zonque at gmail.com
Mon Sep 9 04:51:59 EDT 2013
Hi Ezequiel,
On 06.09.2013 16:40, Ezequiel Garcia wrote:
> There's no need to go through this internal probe/auto-detect
> procedure, since the nand core code will take care of that.
> This commit removes the configuration and detection functions,
> together with the built-in flash device table.
>
> Besides being unneeded, it's also wrong to take care of such details
> wich rightfully belong to the NAND base code. Removing this wrong
> code, prevents the proliferation of the same mistake in future drivers.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
> ---
> This patch doesn't build, because it needs some other patches to be
> applied first. It's not meant for inclusion, but to discuss about
> the possibility of engaging such agressive cleanup on this driver.
Which patch is needed to make this one apply?
> @@ -1064,69 +989,18 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
> {
> struct pxa3xx_nand_host *host = mtd->priv;
> struct pxa3xx_nand_info *info = host->info_data;
> - struct platform_device *pdev = info->pdev;
> - struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
> - struct nand_flash_dev pxa3xx_flash_ids[2], *def = NULL;
> - const struct pxa3xx_nand_flash *f = NULL;
> struct nand_chip *chip = mtd->priv;
> - uint32_t id = -1;
> - uint64_t chipsize;
> - int i, ret, num;
> + int ret;
>
> - if (pdata->keep_config && !pxa3xx_nand_detect_config(info))
> - goto KEEP_CONFIG;
The keep_config pdata setting was necessary in the past in order to
purely rely on the nand controller timing settings as configured by the
bootloader.
I'd like to have another look and test your patch, if you tell me its
dependecy chain.
Daniel
More information about the linux-mtd
mailing list