]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gpio: gpio-stp-xway: remove duplicate check on resource
authorVarka Bhadram <varkabhadram@gmail.com>
Tue, 21 Oct 2014 07:12:59 +0000 (12:42 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 28 Oct 2014 16:06:40 +0000 (17:06 +0100)
Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-stp-xway.c

index 7e359b7cce1b2190ecd7553a6a312d14fa9f32ff..7892e0fa8ba7da8f4db34eac2041539dcaf918c5 100644 (file)
@@ -199,21 +199,17 @@ static int xway_stp_hw_init(struct xway_stp *chip)
 
 static int xway_stp_probe(struct platform_device *pdev)
 {
-       struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       struct resource *res;
        const __be32 *shadow, *groups, *dsl, *phy;
        struct xway_stp *chip;
        struct clk *clk;
        int ret = 0;
 
-       if (!res) {
-               dev_err(&pdev->dev, "failed to request STP resource\n");
-               return -ENOENT;
-       }
-
        chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
        if (!chip)
                return -ENOMEM;
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        chip->virt = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(chip->virt))
                return PTR_ERR(chip->virt);