Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513999 > unrolled thread

[PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-11-02 18:20 +0100
Last post2016-11-07 15:00 +0100
Articles 5 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-02 18:20 +0100
    Re: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions()  calls Marek Vasut <marek.vasut@gmail.com> - 2016-11-05 08:40 +0100
    Re: [PATCH] mtd: nand: denali_pci: add missing  pci_release_regions() calls Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-07 00:00 +0100
    Re: [PATCH] mtd: nand: denali_pci: add missing  pci_release_regions() calls Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-11-07 14:40 +0100
      Re: [PATCH] mtd: nand: denali_pci: add missing  pci_release_regions() calls Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-07 15:00 +0100

#1513999 — [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-02 18:20 +0100
Subject[PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls
Message-ID<sz7mF-J6-17@gated-at.bofh.it>
The probe function calls pci_request_regions(), but I do not see
corresponding pci_release_regions() calls.

While we are here, rename the jump labels to follow the guideline
"Choose label names which say what the goto does" suggested by
Documentation/CodingStyle.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/denali_pci.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/denali_pci.c b/drivers/mtd/nand/denali_pci.c
index de31514..be8152f 100644
--- a/drivers/mtd/nand/denali_pci.c
+++ b/drivers/mtd/nand/denali_pci.c
@@ -76,28 +76,31 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	denali->flash_reg = ioremap_nocache(csr_base, csr_len);
 	if (!denali->flash_reg) {
 		dev_err(&dev->dev, "Spectra: Unable to remap memory region\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto release_regions;
 	}
 
 	denali->flash_mem = ioremap_nocache(mem_base, mem_len);
 	if (!denali->flash_mem) {
 		dev_err(&dev->dev, "Spectra: ioremap_nocache failed!");
 		ret = -ENOMEM;
-		goto failed_remap_reg;
+		goto unmap_reg;
 	}
 
 	ret = denali_init(denali);
 	if (ret)
-		goto failed_remap_mem;
+		goto unmap_mem;
 
 	pci_set_drvdata(dev, denali);
 
 	return 0;
 
-failed_remap_mem:
+unmap_mem:
 	iounmap(denali->flash_mem);
-failed_remap_reg:
+unmap_reg:
 	iounmap(denali->flash_reg);
+release_regions:
+	pci_release_regions(dev);
 	return ret;
 }
 
@@ -109,6 +112,7 @@ static void denali_pci_remove(struct pci_dev *dev)
 	denali_remove(denali);
 	iounmap(denali->flash_reg);
 	iounmap(denali->flash_mem);
+	pci_release_regions(dev);
 }
 
 static struct pci_driver denali_pci_driver = {
-- 
1.9.1

[toc] | [next] | [standalone]


#1515514 — Re: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls

FromMarek Vasut <marek.vasut@gmail.com>
Date2016-11-05 08:40 +0100
SubjectRe: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls
Message-ID<sA3K1-4Yr-5@gated-at.bofh.it>
In reply to#1513999
On 11/02/2016 06:13 PM, Masahiro Yamada wrote:
> The probe function calls pci_request_regions(), but I do not see
> corresponding pci_release_regions() calls.
> 
> While we are here, rename the jump labels to follow the guideline
> "Choose label names which say what the goto does" suggested by
> Documentation/CodingStyle.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

> ---
> 
>  drivers/mtd/nand/denali_pci.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/denali_pci.c b/drivers/mtd/nand/denali_pci.c
> index de31514..be8152f 100644
> --- a/drivers/mtd/nand/denali_pci.c
> +++ b/drivers/mtd/nand/denali_pci.c
> @@ -76,28 +76,31 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  	denali->flash_reg = ioremap_nocache(csr_base, csr_len);
>  	if (!denali->flash_reg) {
>  		dev_err(&dev->dev, "Spectra: Unable to remap memory region\n");
> -		return -ENOMEM;
> +		ret = -ENOMEM;
> +		goto release_regions;
>  	}
>  
>  	denali->flash_mem = ioremap_nocache(mem_base, mem_len);
>  	if (!denali->flash_mem) {
>  		dev_err(&dev->dev, "Spectra: ioremap_nocache failed!");
>  		ret = -ENOMEM;
> -		goto failed_remap_reg;
> +		goto unmap_reg;
>  	}
>  
>  	ret = denali_init(denali);
>  	if (ret)
> -		goto failed_remap_mem;
> +		goto unmap_mem;
>  
>  	pci_set_drvdata(dev, denali);
>  
>  	return 0;
>  
> -failed_remap_mem:
> +unmap_mem:
>  	iounmap(denali->flash_mem);
> -failed_remap_reg:
> +unmap_reg:
>  	iounmap(denali->flash_reg);
> +release_regions:
> +	pci_release_regions(dev);
>  	return ret;
>  }
>  
> @@ -109,6 +112,7 @@ static void denali_pci_remove(struct pci_dev *dev)
>  	denali_remove(denali);
>  	iounmap(denali->flash_reg);
>  	iounmap(denali->flash_mem);
> +	pci_release_regions(dev);
>  }
>  
>  static struct pci_driver denali_pci_driver = {
> 


-- 
Best regards,
Marek Vasut

[toc] | [prev] | [next] | [standalone]


#1515781 — Re: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-11-07 00:00 +0100
SubjectRe: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls
Message-ID<sAEzT-33D-5@gated-at.bofh.it>
In reply to#1513999
On Thu,  3 Nov 2016 02:13:10 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> The probe function calls pci_request_regions(), but I do not see
> corresponding pci_release_regions() calls.
> 
> While we are here, rename the jump labels to follow the guideline
> "Choose label names which say what the goto does" suggested by
> Documentation/CodingStyle.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied.

Thanks,

Boris

> ---
> 
>  drivers/mtd/nand/denali_pci.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/denali_pci.c b/drivers/mtd/nand/denali_pci.c
> index de31514..be8152f 100644
> --- a/drivers/mtd/nand/denali_pci.c
> +++ b/drivers/mtd/nand/denali_pci.c
> @@ -76,28 +76,31 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  	denali->flash_reg = ioremap_nocache(csr_base, csr_len);
>  	if (!denali->flash_reg) {
>  		dev_err(&dev->dev, "Spectra: Unable to remap memory region\n");
> -		return -ENOMEM;
> +		ret = -ENOMEM;
> +		goto release_regions;
>  	}
>  
>  	denali->flash_mem = ioremap_nocache(mem_base, mem_len);
>  	if (!denali->flash_mem) {
>  		dev_err(&dev->dev, "Spectra: ioremap_nocache failed!");
>  		ret = -ENOMEM;
> -		goto failed_remap_reg;
> +		goto unmap_reg;
>  	}
>  
>  	ret = denali_init(denali);
>  	if (ret)
> -		goto failed_remap_mem;
> +		goto unmap_mem;
>  
>  	pci_set_drvdata(dev, denali);
>  
>  	return 0;
>  
> -failed_remap_mem:
> +unmap_mem:
>  	iounmap(denali->flash_mem);
> -failed_remap_reg:
> +unmap_reg:
>  	iounmap(denali->flash_reg);
> +release_regions:
> +	pci_release_regions(dev);
>  	return ret;
>  }
>  
> @@ -109,6 +112,7 @@ static void denali_pci_remove(struct pci_dev *dev)
>  	denali_remove(denali);
>  	iounmap(denali->flash_reg);
>  	iounmap(denali->flash_mem);
> +	pci_release_regions(dev);
>  }
>  
>  static struct pci_driver denali_pci_driver = {

[toc] | [prev] | [next] | [standalone]


#1516197 — Re: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2016-11-07 14:40 +0100
SubjectRe: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls
Message-ID<sASjw-3Kx-29@gated-at.bofh.it>
In reply to#1513999
On Thu, 2016-11-03 at 02:13 +0900, Masahiro Yamada wrote:
> The probe function calls pci_request_regions(), but I do not see
> corresponding pci_release_regions() calls.
> 
> While we are here, rename the jump labels to follow the guideline
> "Choose label names which say what the goto does" suggested by
> Documentation/CodingStyle.

NACK!

Please, remove or revert this patch.
Everything is done in pcim_release() function.

> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  drivers/mtd/nand/denali_pci.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/denali_pci.c
> b/drivers/mtd/nand/denali_pci.c
> index de31514..be8152f 100644
> --- a/drivers/mtd/nand/denali_pci.c
> +++ b/drivers/mtd/nand/denali_pci.c
> @@ -76,28 +76,31 @@ static int denali_pci_probe(struct pci_dev *dev,
> const struct pci_device_id *id)
>  	denali->flash_reg = ioremap_nocache(csr_base, csr_len);
>  	if (!denali->flash_reg) {
>  		dev_err(&dev->dev, "Spectra: Unable to remap memory
> region\n");
> -		return -ENOMEM;
> +		ret = -ENOMEM;
> +		goto release_regions;
>  	}
>  
>  	denali->flash_mem = ioremap_nocache(mem_base, mem_len);
>  	if (!denali->flash_mem) {
>  		dev_err(&dev->dev, "Spectra: ioremap_nocache
> failed!");
>  		ret = -ENOMEM;
> -		goto failed_remap_reg;
> +		goto unmap_reg;
>  	}
>  
>  	ret = denali_init(denali);
>  	if (ret)
> -		goto failed_remap_mem;
> +		goto unmap_mem;
>  
>  	pci_set_drvdata(dev, denali);
>  
>  	return 0;
>  
> -failed_remap_mem:
> +unmap_mem:
>  	iounmap(denali->flash_mem);
> -failed_remap_reg:
> +unmap_reg:
>  	iounmap(denali->flash_reg);
> +release_regions:
> +	pci_release_regions(dev);
>  	return ret;
>  }
>  
> @@ -109,6 +112,7 @@ static void denali_pci_remove(struct pci_dev *dev)
>  	denali_remove(denali);
>  	iounmap(denali->flash_reg);
>  	iounmap(denali->flash_mem);
> +	pci_release_regions(dev);
>  }
>  
>  static struct pci_driver denali_pci_driver = {

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

[toc] | [prev] | [next] | [standalone]


#1516215 — Re: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-11-07 15:00 +0100
SubjectRe: [PATCH] mtd: nand: denali_pci: add missing pci_release_regions() calls
Message-ID<sASCX-3R8-37@gated-at.bofh.it>
In reply to#1516197
On Mon, 07 Nov 2016 15:33:04 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Thu, 2016-11-03 at 02:13 +0900, Masahiro Yamada wrote:
> > The probe function calls pci_request_regions(), but I do not see
> > corresponding pci_release_regions() calls.
> > 
> > While we are here, rename the jump labels to follow the guideline
> > "Choose label names which say what the goto does" suggested by
> > Documentation/CodingStyle.  
> 
> NACK!
> 
> Please, remove or revert this patch.
> Everything is done in pcim_release() function.

Indeed. I'll drop the patch.

Thanks,

Boris

> 
> > 
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> > 
> >  drivers/mtd/nand/denali_pci.c | 14 +++++++++-----
> >  1 file changed, 9 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/denali_pci.c
> > b/drivers/mtd/nand/denali_pci.c
> > index de31514..be8152f 100644
> > --- a/drivers/mtd/nand/denali_pci.c
> > +++ b/drivers/mtd/nand/denali_pci.c
> > @@ -76,28 +76,31 @@ static int denali_pci_probe(struct pci_dev *dev,
> > const struct pci_device_id *id)
> >  	denali->flash_reg = ioremap_nocache(csr_base, csr_len);
> >  	if (!denali->flash_reg) {
> >  		dev_err(&dev->dev, "Spectra: Unable to remap memory
> > region\n");
> > -		return -ENOMEM;
> > +		ret = -ENOMEM;
> > +		goto release_regions;
> >  	}
> >  
> >  	denali->flash_mem = ioremap_nocache(mem_base, mem_len);
> >  	if (!denali->flash_mem) {
> >  		dev_err(&dev->dev, "Spectra: ioremap_nocache
> > failed!");
> >  		ret = -ENOMEM;
> > -		goto failed_remap_reg;
> > +		goto unmap_reg;
> >  	}
> >  
> >  	ret = denali_init(denali);
> >  	if (ret)
> > -		goto failed_remap_mem;
> > +		goto unmap_mem;
> >  
> >  	pci_set_drvdata(dev, denali);
> >  
> >  	return 0;
> >  
> > -failed_remap_mem:
> > +unmap_mem:
> >  	iounmap(denali->flash_mem);
> > -failed_remap_reg:
> > +unmap_reg:
> >  	iounmap(denali->flash_reg);
> > +release_regions:
> > +	pci_release_regions(dev);
> >  	return ret;
> >  }
> >  
> > @@ -109,6 +112,7 @@ static void denali_pci_remove(struct pci_dev *dev)
> >  	denali_remove(denali);
> >  	iounmap(denali->flash_reg);
> >  	iounmap(denali->flash_mem);
> > +	pci_release_regions(dev);
> >  }
> >  
> >  static struct pci_driver denali_pci_driver = {  
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web