linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: edma: Clean up and simplify the code around irq request
@ 2014-05-13  7:26 Peter Ujfalusi
  2014-05-15 12:05 ` Sekhar Nori
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Ujfalusi @ 2014-05-13  7:26 UTC (permalink / raw)
  To: linux-arm-kernel

Get the two interrupt line number at the same time by merging the two
instance of if(node){}else{} places.
replace the &pdev->dev with the already existing dev which makes it possible
to collapse lines with devm_request_irq()

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/common/edma.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index db2d9dc62d33..fade9ada81f8 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1596,7 +1596,6 @@ static int edma_probe(struct platform_device *pdev)
 	struct resource		*r[EDMA_MAX_CC] = {NULL};
 	struct resource		res[EDMA_MAX_CC];
 	char			res_name[10];
-	char			irq_name[10];
 	struct device_node	*node = pdev->dev.of_node;
 	struct device		*dev = &pdev->dev;
 	int			ret;
@@ -1718,14 +1717,21 @@ static int edma_probe(struct platform_device *pdev)
 
 		if (node) {
 			irq[j] = irq_of_parse_and_map(node, 0);
+			err_irq[j] = irq_of_parse_and_map(node, 2);
 		} else {
+			char irq_name[10];
+
 			sprintf(irq_name, "edma%d", j);
 			irq[j] = platform_get_irq_byname(pdev, irq_name);
+
+			sprintf(irq_name, "edma%d_err", j);
+			err_irq[j] = platform_get_irq_byname(pdev, irq_name);
 		}
 		edma_cc[j]->irq_res_start = irq[j];
-		status = devm_request_irq(&pdev->dev, irq[j],
-					  dma_irq_handler, 0, "edma",
-					  &pdev->dev);
+		edma_cc[j]->irq_res_end = err_irq[j];
+
+		status = devm_request_irq(dev, irq[j], dma_irq_handler, 0,
+					  "edma", dev);
 		if (status < 0) {
 			dev_dbg(&pdev->dev,
 				"devm_request_irq %d failed --> %d\n",
@@ -1733,16 +1739,8 @@ static int edma_probe(struct platform_device *pdev)
 			return status;
 		}
 
-		if (node) {
-			err_irq[j] = irq_of_parse_and_map(node, 2);
-		} else {
-			sprintf(irq_name, "edma%d_err", j);
-			err_irq[j] = platform_get_irq_byname(pdev, irq_name);
-		}
-		edma_cc[j]->irq_res_end = err_irq[j];
-		status = devm_request_irq(&pdev->dev, err_irq[j],
-					  dma_ccerr_handler, 0,
-					  "edma_error", &pdev->dev);
+		status = devm_request_irq(dev, err_irq[j], dma_ccerr_handler, 0,
+					  "edma_error", dev);
 		if (status < 0) {
 			dev_dbg(&pdev->dev,
 				"devm_request_irq %d failed --> %d\n",
-- 
1.9.3

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

* [PATCH] ARM: edma: Clean up and simplify the code around irq request
  2014-05-13  7:26 [PATCH] ARM: edma: Clean up and simplify the code around irq request Peter Ujfalusi
@ 2014-05-15 12:05 ` Sekhar Nori
  2014-05-20  5:57   ` Olof Johansson
  0 siblings, 1 reply; 4+ messages in thread
From: Sekhar Nori @ 2014-05-15 12:05 UTC (permalink / raw)
  To: linux-arm-kernel

+ ARM SoC team

On Tuesday 13 May 2014 12:56 PM, Peter Ujfalusi wrote:
> Get the two interrupt line number at the same time by merging the two
> instance of if(node){}else{} places.
> replace the &pdev->dev with the already existing dev which makes it possible
> to collapse lines with devm_request_irq()
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Acked-by: Sekhar Nori <nsekhar@ti.com>

Arnd, Olof, Kevin,

Do you mind applying this directly for v3.16? I do not have anything
else queued ATM so not sending a pull request.

Thanks,
Sekhar

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

* [PATCH] ARM: edma: Clean up and simplify the code around irq request
  2014-05-15 12:05 ` Sekhar Nori
@ 2014-05-20  5:57   ` Olof Johansson
  2014-05-20  6:23     ` Sekhar Nori
  0 siblings, 1 reply; 4+ messages in thread
From: Olof Johansson @ 2014-05-20  5:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 15, 2014 at 05:35:01PM +0530, Sekhar Nori wrote:
> + ARM SoC team
> 
> On Tuesday 13 May 2014 12:56 PM, Peter Ujfalusi wrote:
> > Get the two interrupt line number at the same time by merging the two
> > instance of if(node){}else{} places.
> > replace the &pdev->dev with the already existing dev which makes it possible
> > to collapse lines with devm_request_irq()
> > 
> > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> 
> Acked-by: Sekhar Nori <nsekhar@ti.com>
> 
> Arnd, Olof, Kevin,
> 
> Do you mind applying this directly for v3.16? I do not have anything
> else queued ATM so not sending a pull request.

I see it was reposted today as part of a larger patch set with some
question as to what it applies to.

Sekhar, if you just have one patch for us to apply, then feel free to
resend it to use (git send-email --to=arm at kernel.org) and make it clear
(below the --- separator) that you want us to apply it directly, and
we'll be happy to do so.


-Olof

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

* [PATCH] ARM: edma: Clean up and simplify the code around irq request
  2014-05-20  5:57   ` Olof Johansson
@ 2014-05-20  6:23     ` Sekhar Nori
  0 siblings, 0 replies; 4+ messages in thread
From: Sekhar Nori @ 2014-05-20  6:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 20 May 2014 11:27 AM, Olof Johansson wrote:
> On Thu, May 15, 2014 at 05:35:01PM +0530, Sekhar Nori wrote:
>> + ARM SoC team
>>
>> On Tuesday 13 May 2014 12:56 PM, Peter Ujfalusi wrote:
>>> Get the two interrupt line number at the same time by merging the two
>>> instance of if(node){}else{} places.
>>> replace the &pdev->dev with the already existing dev which makes it possible
>>> to collapse lines with devm_request_irq()
>>>
>>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>>
>> Acked-by: Sekhar Nori <nsekhar@ti.com>
>>
>> Arnd, Olof, Kevin,
>>
>> Do you mind applying this directly for v3.16? I do not have anything
>> else queued ATM so not sending a pull request.
> 
> I see it was reposted today as part of a larger patch set with some
> question as to what it applies to.

That 13 patch set from Peter does not include this patch. If you have
not applied this directly, I will send everything together as a pull
request.

> Sekhar, if you just have one patch for us to apply, then feel free to
> resend it to use (git send-email --to=arm at kernel.org) and make it clear
> (below the --- separator) that you want us to apply it directly, and
> we'll be happy to do so.

Okay, will do so in future.

Thanks,
Sekhar

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

end of thread, other threads:[~2014-05-20  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-13  7:26 [PATCH] ARM: edma: Clean up and simplify the code around irq request Peter Ujfalusi
2014-05-15 12:05 ` Sekhar Nori
2014-05-20  5:57   ` Olof Johansson
2014-05-20  6:23     ` Sekhar Nori

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