Patchwork mtd: bcm963xx-flash: try JEDEC probe if CFI fails

login
register
mail settings
Submitter Guillaume LECERF
Date Oct. 29, 2010, 2:17 p.m.
Message ID <20101029141749.23774.90495.stgit@dev.siriade.com>
Download mbox | patch
Permalink /patch/69592/
State Accepted
Headers show

Comments

Guillaume LECERF - Oct. 29, 2010, 2:17 p.m.
Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
---
 drivers/mtd/maps/bcm963xx-flash.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Florian Fainelli - Oct. 29, 2010, 4:32 p.m.
On Friday 29 October 2010 16:17:49 Guillaume LECERF wrote:
> Signed-off-by: Guillaume LECERF <glecerf@gmail.com>

Acked-by: Florian Fainelli <florian@openwrt.org>

> ---
>  drivers/mtd/maps/bcm963xx-flash.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/maps/bcm963xx-flash.c
> b/drivers/mtd/maps/bcm963xx-flash.c index d175c12..1f30495 100644
> --- a/drivers/mtd/maps/bcm963xx-flash.c
> +++ b/drivers/mtd/maps/bcm963xx-flash.c
> @@ -196,10 +196,15 @@ static int bcm963xx_probe(struct platform_device
> *pdev) bcm963xx_mtd_info = do_map_probe("cfi_probe", &bcm963xx_map);
>  	if (!bcm963xx_mtd_info) {
>  		dev_err(&pdev->dev, "failed to probe using CFI\n");
> +		bcm963xx_mtd_info = do_map_probe("jedec_probe", &bcm963xx_map);
> +		if (bcm963xx_mtd_info)
> +			goto probe_ok;
> +		dev_err(&pdev->dev, "failed to probe using JEDEC\n");
>  		err = -EIO;
>  		goto err_probe;
>  	}
> 
> +probe_ok:
>  	bcm963xx_mtd_info->owner = THIS_MODULE;
> 
>  	/* This is mutually exclusive */
Artem Bityutskiy - Nov. 13, 2010, 9:39 a.m.
On Fri, 2010-10-29 at 16:17 +0200, Guillaume LECERF wrote:
> Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
> ---
>  drivers/mtd/maps/bcm963xx-flash.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Pushed to l2-mtd-2.6.git, thanks you.

Patch

diff --git a/drivers/mtd/maps/bcm963xx-flash.c b/drivers/mtd/maps/bcm963xx-flash.c
index d175c12..1f30495 100644
--- a/drivers/mtd/maps/bcm963xx-flash.c
+++ b/drivers/mtd/maps/bcm963xx-flash.c
@@ -196,10 +196,15 @@  static int bcm963xx_probe(struct platform_device *pdev)
 	bcm963xx_mtd_info = do_map_probe("cfi_probe", &bcm963xx_map);
 	if (!bcm963xx_mtd_info) {
 		dev_err(&pdev->dev, "failed to probe using CFI\n");
+		bcm963xx_mtd_info = do_map_probe("jedec_probe", &bcm963xx_map);
+		if (bcm963xx_mtd_info)
+			goto probe_ok;
+		dev_err(&pdev->dev, "failed to probe using JEDEC\n");
 		err = -EIO;
 		goto err_probe;
 	}
 
+probe_ok:
 	bcm963xx_mtd_info->owner = THIS_MODULE;
 
 	/* This is mutually exclusive */