linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] arm: mach-omap2: omap_l3_smx: fix request_irq() error path
@ 2011-03-24 16:35 Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe Aaro Koskinen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Aaro Koskinen @ 2011-03-24 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

The debug irq should be freed on the error path.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/arm/mach-omap2/omap_l3_smx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_l3_smx.c b/arch/arm/mach-omap2/omap_l3_smx.c
index 265bff3..02528cb 100644
--- a/arch/arm/mach-omap2/omap_l3_smx.c
+++ b/arch/arm/mach-omap2/omap_l3_smx.c
@@ -273,6 +273,7 @@ static int __init omap3_l3_probe(struct platform_device *pdev)
 	goto err0;
 
 err4:
+	free_irq(l3->debug_irq, l3);
 err3:
 	iounmap(l3->rt);
 err2:
-- 
1.5.6.5

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

* [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe
  2011-03-24 16:35 [PATCH 1/6] arm: mach-omap2: omap_l3_smx: fix request_irq() error path Aaro Koskinen
@ 2011-03-24 16:35 ` Aaro Koskinen
  2011-03-24 17:18   ` Kevin Hilman
  2011-03-24 16:35 ` [PATCH 3/6] arm: mach-omap2: smartreflex: request the memory region Aaro Koskinen
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Aaro Koskinen @ 2011-03-24 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

sr_late_init() will take care of freeing the resources.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/arm/mach-omap2/smartreflex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 8f674c9..6dfc8db 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -883,7 +883,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		ret = sr_late_init(sr_info);
 		if (ret) {
 			pr_warning("%s: Error in SR late init\n", __func__);
-			goto err_release_region;
+			return ret;
 		}
 	}
 
-- 
1.5.6.5

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

* [PATCH 3/6] arm: mach-omap2: smartreflex: request the memory region
  2011-03-24 16:35 [PATCH 1/6] arm: mach-omap2: omap_l3_smx: fix request_irq() error path Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe Aaro Koskinen
@ 2011-03-24 16:35 ` Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 4/6] arm: mach-omap2: smartreflex: fix ioremap leak on probe error Aaro Koskinen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Aaro Koskinen @ 2011-03-24 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

We are releasing the memory region, but never actually request it.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/arm/mach-omap2/smartreflex.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 6dfc8db..81bd5ed 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -847,6 +847,14 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		goto err_free_devinfo;
 	}
 
+	mem = request_mem_region(mem->start, resource_size(mem),
+					dev_name(&pdev->dev));
+	if (!mem) {
+		dev_err(&pdev->dev, "%s: no mem region\n", __func__);
+		ret = -EBUSY;
+		goto err_free_devinfo;
+	}
+
 	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 
 	pm_runtime_enable(&pdev->dev);
-- 
1.5.6.5

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

* [PATCH 4/6] arm: mach-omap2: smartreflex: fix ioremap leak on probe error
  2011-03-24 16:35 [PATCH 1/6] arm: mach-omap2: omap_l3_smx: fix request_irq() error path Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 3/6] arm: mach-omap2: smartreflex: request the memory region Aaro Koskinen
@ 2011-03-24 16:35 ` Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 5/6] arm: mach-omap2: smartreflex: delete instance from sr_list " Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 6/6] arm: mach-omap2: smartreflex: delete debugfs entries " Aaro Koskinen
  4 siblings, 0 replies; 9+ messages in thread
From: Aaro Koskinen @ 2011-03-24 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

Add missing iounmap() to error paths.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/arm/mach-omap2/smartreflex.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 81bd5ed..e72b419 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -904,7 +904,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
 	if (!vdd_dbg_dir) {
 		ret = -EINVAL;
-		goto err_release_region;
+		goto err_iounmap;
 	}
 
 	sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
@@ -912,7 +912,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
 			__func__);
 		ret = PTR_ERR(sr_info->dbg_dir);
-		goto err_release_region;
+		goto err_iounmap;
 	}
 
 	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
@@ -929,7 +929,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
 			"for n-values\n", __func__);
 		ret = PTR_ERR(nvalue_dir);
-		goto err_release_region;
+		goto err_iounmap;
 	}
 
 	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
@@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 			"entries for n-values\n",
 			__func__, sr_info->voltdm->name);
 		ret = -ENODATA;
-		goto err_release_region;
+		goto err_iounmap;
 	}
 
 	for (i = 0; i < sr_info->nvalue_count; i++) {
@@ -953,6 +953,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 
 	return ret;
 
+err_iounmap:
+	iounmap(sr_info->base);
 err_release_region:
 	release_mem_region(mem->start, resource_size(mem));
 err_free_devinfo:
-- 
1.5.6.5

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

* [PATCH 5/6] arm: mach-omap2: smartreflex: delete instance from sr_list on probe error
  2011-03-24 16:35 [PATCH 1/6] arm: mach-omap2: omap_l3_smx: fix request_irq() error path Aaro Koskinen
                   ` (2 preceding siblings ...)
  2011-03-24 16:35 ` [PATCH 4/6] arm: mach-omap2: smartreflex: fix ioremap leak on probe error Aaro Koskinen
@ 2011-03-24 16:35 ` Aaro Koskinen
  2011-03-24 16:35 ` [PATCH 6/6] arm: mach-omap2: smartreflex: delete debugfs entries " Aaro Koskinen
  4 siblings, 0 replies; 9+ messages in thread
From: Aaro Koskinen @ 2011-03-24 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

If the probe fails, the node should be deleted from sr_list.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/arm/mach-omap2/smartreflex.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index e72b419..c8cd1ef 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -954,6 +954,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	return ret;
 
 err_iounmap:
+	list_del(&sr_info->node);
 	iounmap(sr_info->base);
 err_release_region:
 	release_mem_region(mem->start, resource_size(mem));
-- 
1.5.6.5

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

* [PATCH 6/6] arm: mach-omap2: smartreflex: delete debugfs entries on probe error
  2011-03-24 16:35 [PATCH 1/6] arm: mach-omap2: omap_l3_smx: fix request_irq() error path Aaro Koskinen
                   ` (3 preceding siblings ...)
  2011-03-24 16:35 ` [PATCH 5/6] arm: mach-omap2: smartreflex: delete instance from sr_list " Aaro Koskinen
@ 2011-03-24 16:35 ` Aaro Koskinen
  4 siblings, 0 replies; 9+ messages in thread
From: Aaro Koskinen @ 2011-03-24 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

Delete created debugfs entries if probe fails.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/arm/mach-omap2/smartreflex.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index c8cd1ef..85d8167 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -929,7 +929,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
 			"for n-values\n", __func__);
 		ret = PTR_ERR(nvalue_dir);
-		goto err_iounmap;
+		goto err_debugfs;
 	}
 
 	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
@@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 			"entries for n-values\n",
 			__func__, sr_info->voltdm->name);
 		ret = -ENODATA;
-		goto err_iounmap;
+		goto err_debugfs;
 	}
 
 	for (i = 0; i < sr_info->nvalue_count; i++) {
@@ -953,6 +953,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 
 	return ret;
 
+err_debugfs:
+	debugfs_remove_recursive(sr_info->dbg_dir);
 err_iounmap:
 	list_del(&sr_info->node);
 	iounmap(sr_info->base);
-- 
1.5.6.5

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

* [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe
  2011-03-24 16:35 ` [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe Aaro Koskinen
@ 2011-03-24 17:18   ` Kevin Hilman
  2011-03-25  3:50     ` Nishanth Menon
  0 siblings, 1 reply; 9+ messages in thread
From: Kevin Hilman @ 2011-03-24 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

Aaro Koskinen <aaro.koskinen@nokia.com> writes:

> sr_late_init() will take care of freeing the resources.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>

Thanks,

As I've already got some other SR related stuff queued up for 2.6.39,
I'll queue patches 2-6 for the 2.6.39-rc fixes cycle.

Tony can take patch 1 as he see's fit.

Also, I renamed the subject/shortlog to use 'OMAP2+: smartreflex: ..."
instead of 'arm: mach-omap2'.

Kevin

> ---
>  arch/arm/mach-omap2/smartreflex.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 8f674c9..6dfc8db 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -883,7 +883,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  		ret = sr_late_init(sr_info);
>  		if (ret) {
>  			pr_warning("%s: Error in SR late init\n", __func__);
> -			goto err_release_region;
> +			return ret;
>  		}
>  	}

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

* [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe
  2011-03-24 17:18   ` Kevin Hilman
@ 2011-03-25  3:50     ` Nishanth Menon
  2011-03-25 14:51       ` Kevin Hilman
  0 siblings, 1 reply; 9+ messages in thread
From: Nishanth Menon @ 2011-03-25  3:50 UTC (permalink / raw)
  To: linux-arm-kernel

Kevin Hilman wrote, on 03/24/2011 10:48 PM:
> Also, I renamed the subject/shortlog to use 'OMAP2+: smartreflex: ..."
> instead of 'arm: mach-omap2'.
might be better to be OMAP3+ we dont have SR on OMAP2 :)

-- 
Regards,
Nishanth Menon

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

* [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe
  2011-03-25  3:50     ` Nishanth Menon
@ 2011-03-25 14:51       ` Kevin Hilman
  0 siblings, 0 replies; 9+ messages in thread
From: Kevin Hilman @ 2011-03-25 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

Nishanth Menon <nm@ti.com> writes:

> Kevin Hilman wrote, on 03/24/2011 10:48 PM:
>> Also, I renamed the subject/shortlog to use 'OMAP2+: smartreflex: ..."
>> instead of 'arm: mach-omap2'.
>
> might be better to be OMAP3+ we dont have SR on OMAP2 :)
>

Good point.  Will use OMAP3+.

Thanks,

Kevin

P.S. Nishanth, as you are one of the primary developers on SR, any
     acks, reviewed-bys from you are most welcome on SR patches.
     Thanks.

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

end of thread, other threads:[~2011-03-25 14:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 16:35 [PATCH 1/6] arm: mach-omap2: omap_l3_smx: fix request_irq() error path Aaro Koskinen
2011-03-24 16:35 ` [PATCH 2/6] arm: mach-omap2: smartreflex: fix sr_late_init() error path in probe Aaro Koskinen
2011-03-24 17:18   ` Kevin Hilman
2011-03-25  3:50     ` Nishanth Menon
2011-03-25 14:51       ` Kevin Hilman
2011-03-24 16:35 ` [PATCH 3/6] arm: mach-omap2: smartreflex: request the memory region Aaro Koskinen
2011-03-24 16:35 ` [PATCH 4/6] arm: mach-omap2: smartreflex: fix ioremap leak on probe error Aaro Koskinen
2011-03-24 16:35 ` [PATCH 5/6] arm: mach-omap2: smartreflex: delete instance from sr_list " Aaro Koskinen
2011-03-24 16:35 ` [PATCH 6/6] arm: mach-omap2: smartreflex: delete debugfs entries " Aaro Koskinen

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).