All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma: pl330: Simplify irq allocation
@ 2013-09-04 14:40 Michal Simek
  2013-09-12 13:42 ` Vinod Koul
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2013-09-04 14:40 UTC (permalink / raw)
  To: linux-kernel, monstr; +Cc: Vinod Koul, Dan Williams

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

Use devm_request_irq function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/dma/pl330.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index fa645d8..1989e4c 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2930,7 +2930,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	amba_set_drvdata(adev, pdmac);

 	irq = adev->irq[0];
-	ret = request_irq(irq, pl330_irq_handler, 0,
+	ret = devm_request_irq(&adev->dev, irq, pl330_irq_handler, 0,
 			dev_name(&adev->dev), pi);
 	if (ret)
 		return ret;
@@ -2938,7 +2938,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	pi->pcfg.periph_id = adev->periphid;
 	ret = pl330_add(pi);
 	if (ret)
-		goto probe_err1;
+		return ret;

 	INIT_LIST_HEAD(&pdmac->desc_pool);
 	spin_lock_init(&pdmac->pool_lock);
@@ -3041,8 +3041,6 @@ probe_err3:
 	}
 probe_err2:
 	pl330_del(pi);
-probe_err1:
-	free_irq(irq, pi);

 	return ret;
 }
@@ -3052,7 +3050,6 @@ static int pl330_remove(struct amba_device *adev)
 	struct dma_pl330_dmac *pdmac = amba_get_drvdata(adev);
 	struct dma_pl330_chan *pch, *_p;
 	struct pl330_info *pi;
-	int irq;

 	if (!pdmac)
 		return 0;
@@ -3079,9 +3076,6 @@ static int pl330_remove(struct amba_device *adev)

 	pl330_del(pi);

-	irq = adev->irq[0];
-	free_irq(irq, pi);
-
 	return 0;
 }

--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] dma: pl330: Simplify irq allocation
  2013-09-04 14:40 [PATCH] dma: pl330: Simplify irq allocation Michal Simek
@ 2013-09-12 13:42 ` Vinod Koul
  2013-09-13  9:33   ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: Vinod Koul @ 2013-09-12 13:42 UTC (permalink / raw)
  To: Michal Simek; +Cc: linux-kernel, monstr, Dan Williams

[-- Attachment #1: Type: text/plain, Size: 120 bytes --]

On Wed, Sep 04, 2013 at 04:40:17PM +0200, Michal Simek wrote:
> Use devm_request_irq function.

Applied, thanks

~Vinod

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] dma: pl330: Simplify irq allocation
  2013-09-12 13:42 ` Vinod Koul
@ 2013-09-13  9:33   ` Michal Simek
  2013-09-17  7:07     ` Vinod Koul
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2013-09-13  9:33 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Michal Simek, linux-kernel, Dan Williams

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

On 09/12/2013 03:42 PM, Vinod Koul wrote:
> On Wed, Sep 04, 2013 at 04:40:17PM +0200, Michal Simek wrote:
>> Use devm_request_irq function.
> 
> Applied, thanks

Thanks. I have one change in my tree which I would like to get to the mainline
but it will need more interaction with others pl330 users.
It is about adding support for interrupt per channel feature.
For our case we have 8 channels and every channel has specific interrupt
+ we have one abort IRQ.

Based on the binding and Linux code two changes are necessary.
1. Extend AMBA_NR_IRQS because we have 9 IRQs
2. Driver change which is just register irqs when they are available.

Are these two changes OK for you?

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

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

* Re: [PATCH] dma: pl330: Simplify irq allocation
  2013-09-13  9:33   ` Michal Simek
@ 2013-09-17  7:07     ` Vinod Koul
  0 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2013-09-17  7:07 UTC (permalink / raw)
  To: Michal Simek; +Cc: Michal Simek, linux-kernel, Dan Williams

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

On Fri, Sep 13, 2013 at 11:33:33AM +0200, Michal Simek wrote:
> On 09/12/2013 03:42 PM, Vinod Koul wrote:
> > On Wed, Sep 04, 2013 at 04:40:17PM +0200, Michal Simek wrote:
> >> Use devm_request_irq function.
> > 
> > Applied, thanks
> 
> Thanks. I have one change in my tree which I would like to get to the mainline
> but it will need more interaction with others pl330 users.
> It is about adding support for interrupt per channel feature.
> For our case we have 8 channels and every channel has specific interrupt
> + we have one abort IRQ.
> 
> Based on the binding and Linux code two changes are necessary.
> 1. Extend AMBA_NR_IRQS because we have 9 IRQs
> 2. Driver change which is just register irqs when they are available.
> 
> Are these two changes OK for you?
Sure lets review them.

~Vinod
-- 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH] dma: pl330: Simplify irq allocation
@ 2013-09-12  5:41 Michal Simek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2013-09-12  5:41 UTC (permalink / raw)
  To: linux-kernel, monstr; +Cc: Dan Williams, Vinod Koul

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

Use devm_request_irq function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/dma/pl330.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index a562d24..58623dc 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2923,7 +2923,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	amba_set_drvdata(adev, pdmac);

 	irq = adev->irq[0];
-	ret = request_irq(irq, pl330_irq_handler, 0,
+	ret = devm_request_irq(&adev->dev, irq, pl330_irq_handler, 0,
 			dev_name(&adev->dev), pi);
 	if (ret)
 		return ret;
@@ -2931,7 +2931,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	pi->pcfg.periph_id = adev->periphid;
 	ret = pl330_add(pi);
 	if (ret)
-		goto probe_err1;
+		return ret;

 	INIT_LIST_HEAD(&pdmac->desc_pool);
 	spin_lock_init(&pdmac->pool_lock);
@@ -3044,8 +3044,6 @@ probe_err3:
 	}
 probe_err2:
 	pl330_del(pi);
-probe_err1:
-	free_irq(irq, pi);

 	return ret;
 }
@@ -3055,7 +3053,6 @@ static int pl330_remove(struct amba_device *adev)
 	struct dma_pl330_dmac *pdmac = amba_get_drvdata(adev);
 	struct dma_pl330_chan *pch, *_p;
 	struct pl330_info *pi;
-	int irq;

 	if (!pdmac)
 		return 0;
@@ -3082,9 +3079,6 @@ static int pl330_remove(struct amba_device *adev)

 	pl330_del(pi);

-	irq = adev->irq[0];
-	free_irq(irq, pi);
-
 	return 0;
 }

--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2013-09-17  7:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-04 14:40 [PATCH] dma: pl330: Simplify irq allocation Michal Simek
2013-09-12 13:42 ` Vinod Koul
2013-09-13  9:33   ` Michal Simek
2013-09-17  7:07     ` Vinod Koul
2013-09-12  5:41 Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.