mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dongjin Kim <tobetter@gmail.com>
To: linux-samsung-soc@vger.kernel.org
Cc: Dongjin Kim <tobetter@gmail.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT
Date: Thu, 27 Dec 2012 03:42:21 +0900	[thread overview]
Message-ID: <1356547341-23620-3-git-send-email-tobetter@gmail.com> (raw)
In-Reply-To: <1356547341-23620-1-git-send-email-tobetter@gmail.com>

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


  parent reply	other threads:[~2012-12-26 18:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1356547341-23620-1-git-send-email-tobetter@gmail.com>
2012-12-26 18:42 ` [PATCH 1/2] ARM: dts: Add EHCI device tree node for Exynos4 Dongjin Kim
2012-12-26 18:42 ` Dongjin Kim [this message]
2012-12-26 20:18   ` [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT Sergei Shtylyov
2012-12-27 11:58     ` Dongjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356547341-23620-3-git-send-email-tobetter@gmail.com \
    --to=tobetter@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®