Re: [RFC/PATCH 2/2] usb: host: xhci: give xhci a platform_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 14-06-2011 16:39, Felipe Balbi wrote:

NOT FOR MERGING!!!

it will make it simpler to re-use the stack
if it's not tied to a particular bus. Later
patches should come to phase PCI bus to a
separate piece of code which doesn't touch
xhci.c.

NYET-Signed-off-by: Felipe Balbi<balbi@xxxxxx>
---
  drivers/usb/host/xhci.c |  179 ++++++++++++++++++++++++++++++++++++++++++++++-
  1 files changed, 178 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 06e7023..fe06de1 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
[...]
@@ -2997,6 +3005,173 @@ MODULE_DESCRIPTION(DRIVER_DESC);
[...]
+static int xhci_probe(struct platform_device *pdev)
+{
+	struct usb_hcd		*hcd;
+	struct xhci_hcd		*xhci;
+	struct resource		*res;
+
+	int			irq;
+	int			ret;
+
+	if (usb_disabled())
+		return -ENODEV;
+
+	irq = platform_get_irq(pdev, 0);
+	if (!irq) {

   Well, platform_get_irq() returns -ENXIO on error, so this should probably be:

	if (irq <= 0)

+		dev_err(&pdev->dev, "No IRQ found\n");
+		ret = -ENODEV;
+		goto err0;
+	}

+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(&pdev->dev, "missing memory resource\n");
+		ret = -ENOMEM;

   Rather -ENODEV or -EXDEV...

+	hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
+	if (!hcd->regs) {
+		dev_err(&pdev->dev, "error mapping memory\n");
+		ret = -EFAULT;

   Rather -ENOMEM.

+		goto err2;
+	}
+
+	ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
+	if (ret != 0) {

	if (ret)

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux