]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: renesas_usbhs: common: remove duplicate check on resource
authorVarka Bhadram <varkabhadram@gmail.com>
Wed, 29 Oct 2014 16:00:16 +0000 (21:30 +0530)
committerFelipe Balbi <balbi@ti.com>
Mon, 3 Nov 2014 16:01:20 +0000 (10:01 -0600)
Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/common.c

index 6dae1151569bc5fd3c7287b6815df88faa43c42e..169307ba08b71059e12b4036f81cea5b07de6ba3 100644 (file)
@@ -496,9 +496,8 @@ static int usbhs_probe(struct platform_device *pdev)
        }
 
        /* platform data */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       if (!res || !irq_res) {
+       if (!irq_res) {
                dev_err(&pdev->dev, "Not enough Renesas USB platform resources.\n");
                return -ENODEV;
        }
@@ -508,6 +507,7 @@ static int usbhs_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        priv->base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);