lkml.org 
[lkml]   [2012]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT
Date
This patch support to get interrupt resource from device tree as well as
platform device if ehci node is defined in device tree and it's irq is
described.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
---
drivers/usb/host/ehci-s5p.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 319dcfa..0fc5e5e 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -16,6 +16,7 @@
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/of_gpio.h>
+#include <linux/of_irq.h>
#include <linux/platform_data/usb-ehci-s5p.h>
#include <plat/usb-phy.h>

@@ -156,7 +157,12 @@ static int s5p_ehci_probe(struct platform_device *pdev)
goto fail_io;
}

- irq = platform_get_irq(pdev, 0);
+ if (pdev->dev.of_node)
+ irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
+ else {
+ irq = platform_get_irq(pdev, 0);
+ }
+
if (!irq) {
dev_err(&pdev->dev, "Failed to get IRQ\n");
err = -ENODEV;
--
1.7.10.4


\
 
 \ /
  Last update: 2012-12-26 20:21    [W:0.034 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site