Re: [PATCH 1/3] PCI: rcar: check platform_get_irq() return code

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

 



On 01/28/2014 02:06 PM, Ben Dooks wrote:
The current code does not check the return from platform_get_irq()
so add an error check and return if this call does fail.


If you have really experienced this error your platform data is incorrect.

Signed-off-by: Ben Dooks <ben.dooks@xxxxxxxxxxxxxxx>

Acked-by: Valentine Barshak <valentine.barshak@xxxxxxxxxxxxxxxxxx>

---
Cc: Valentine Barshak <valentine.barshak@xxxxxxxxxxxxxxxxxx>
Cc: Simon Horman <horms@xxxxxxxxxxxx>
Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: linux-pci@xxxxxxxxxxxxxxx
Cc: linux-sh@xxxxxxxxxxxxxxx
---
  drivers/pci/host/pci-rcar-gen2.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index ea65bac..674f7fe 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -308,6 +308,11 @@ static int __init rcar_pci_probe(struct platform_device *pdev)
  	priv->reg = reg;
  	priv->dev = &pdev->dev;

+	if (priv->irq < 0) {
+		dev_err(&pdev->dev, "no valid irq found\n");
+		return priv->irq;
+	}
+
  	return rcar_pci_add_controller(priv);
  }



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




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux