[spi,6/7] spi-mxs: remove duplicate check on resource
diff mbox

Message ID 1413885950-24208-6-git-send-email-varkab@cdac.in
State New, archived
Headers show

Commit Message

Varka Bhadram Oct. 21, 2014, 10:05 a.m. UTC
Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 drivers/spi/spi-mxs.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch
diff mbox

diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 22a0af0..778cb98 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -536,15 +536,15 @@  static int mxs_spi_probe(struct platform_device *pdev)
 	const int clk_freq_default = 160000000;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	irq_err = platform_get_irq(pdev, 0);
-	irq_dma = platform_get_irq(pdev, 1);
-	if (!iores || irq_err < 0 || irq_dma < 0)
-		return -EINVAL;
-
 	base = devm_ioremap_resource(&pdev->dev, iores);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
+	irq_err = platform_get_irq(pdev, 0);
+	irq_dma = platform_get_irq(pdev, 1);
+	if (irq_err < 0 || irq_dma < 0)
+		return -EINVAL;
+
 	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 	if (IS_ERR(pinctrl))
 		return PTR_ERR(pinctrl);