renesas_usbhs: common: remove duplicate check on resource
authorVarka Bhadram <varkab@cdac.in>
Tue, 4 Nov 2014 02:21:34 +0000 (07:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:01:51 +0000 (09:01 -0800)
Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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);