linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 -next] mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove
@ 2024-08-26  2:43 Chen Ridong
  2024-08-26  8:11 ` Miquel Raynal
  2024-09-06 15:04 ` Miquel Raynal
  0 siblings, 2 replies; 4+ messages in thread
From: Chen Ridong @ 2024-08-26  2:43 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr, chenridong; +Cc: linux-mtd

The pci_release_regions was miss at error case, just add it.

Signed-off-by: Chen Ridong <chenridong@huawei.com>
---
 drivers/mtd/nand/raw/denali_pci.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/denali_pci.c b/drivers/mtd/nand/raw/denali_pci.c
index de7e722d3826..e22094e39546 100644
--- a/drivers/mtd/nand/raw/denali_pci.c
+++ b/drivers/mtd/nand/raw/denali_pci.c
@@ -77,18 +77,20 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	denali->reg = devm_ioremap(denali->dev, csr_base, csr_len);
 	if (!denali->reg) {
 		dev_err(&dev->dev, "Spectra: Unable to remap memory region\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto regions_release;
 	}
 
 	denali->host = devm_ioremap(denali->dev, mem_base, mem_len);
 	if (!denali->host) {
 		dev_err(&dev->dev, "Spectra: ioremap failed!");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto regions_release;
 	}
 
 	ret = denali_init(denali);
 	if (ret)
-		return ret;
+		goto regions_release;
 
 	nsels = denali->nbanks;
 
@@ -116,6 +118,8 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 out_remove_denali:
 	denali_remove(denali);
+regions_release:
+	pci_release_regions(dev);
 	return ret;
 }
 
@@ -123,6 +127,7 @@ static void denali_pci_remove(struct pci_dev *dev)
 {
 	struct denali_controller *denali = pci_get_drvdata(dev);
 
+	pci_release_regions(dev);
 	denali_remove(denali);
 }
 
-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 -next] mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove
  2024-08-26  2:43 [PATCH v2 -next] mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove Chen Ridong
@ 2024-08-26  8:11 ` Miquel Raynal
  2024-08-26  8:45   ` Chen Ridong
  2024-09-06 15:04 ` Miquel Raynal
  1 sibling, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2024-08-26  8:11 UTC (permalink / raw)
  To: Chen Ridong; +Cc: richard, vigneshr, chenridong, linux-mtd

Hi Chen,

chenridong@huawei.com wrote on Mon, 26 Aug 2024 02:43:39 +0000:

> The pci_release_regions was miss at error case, just add it.
> 
> Signed-off-by: Chen Ridong <chenridong@huawei.com>
> ---

Next time please add a changelog here, below the ---.

No need to resend for this time.

>  drivers/mtd/nand/raw/denali_pci.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 -next] mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove
  2024-08-26  8:11 ` Miquel Raynal
@ 2024-08-26  8:45   ` Chen Ridong
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Ridong @ 2024-08-26  8:45 UTC (permalink / raw)
  To: Miquel Raynal; +Cc: richard, vigneshr, linux-mtd



On 2024/8/26 16:11, Miquel Raynal wrote:
> Hi Chen,
> 
> chenridong@huawei.com wrote on Mon, 26 Aug 2024 02:43:39 +0000:
> 
>> The pci_release_regions was miss at error case, just add it.
>>
>> Signed-off-by: Chen Ridong <chenridong@huawei.com>
>> ---
> 
> Next time please add a changelog here, below the ---.
> 
> No need to resend for this time.
> 
>>   drivers/mtd/nand/raw/denali_pci.c | 11 ++++++++---
>>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> Thanks,
> Miquèl

Apologies for the missing change log.

Thank you for your reminder.

Best regards,
Ridong


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 -next] mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove
  2024-08-26  2:43 [PATCH v2 -next] mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove Chen Ridong
  2024-08-26  8:11 ` Miquel Raynal
@ 2024-09-06 15:04 ` Miquel Raynal
  1 sibling, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2024-09-06 15:04 UTC (permalink / raw)
  To: Chen Ridong, miquel.raynal, richard, vigneshr, chenridong; +Cc: linux-mtd

On Mon, 2024-08-26 at 02:43:39 UTC, Chen Ridong wrote:
> The pci_release_regions was miss at error case, just add it.
> 
> Signed-off-by: Chen Ridong <chenridong@huawei.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-06 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26  2:43 [PATCH v2 -next] mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove Chen Ridong
2024-08-26  8:11 ` Miquel Raynal
2024-08-26  8:45   ` Chen Ridong
2024-09-06 15:04 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).