Merge branch 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / drivers / gpio / gpio-mpc8xxx.c
index 67dc389..70d6ae2 100644 (file)
@@ -332,7 +332,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
                                 mpc8xxx_gc->regs + GPIO_DIR, NULL,
                                 BGPIOF_BIG_ENDIAN);
                if (ret)
-                       goto err;
+                       return ret;
                dev_dbg(&pdev->dev, "GPIO registers are LITTLE endian\n");
        } else {
                ret = bgpio_init(gc, &pdev->dev, 4,
@@ -342,7 +342,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
                                 BGPIOF_BIG_ENDIAN
                                 | BGPIOF_BIG_ENDIAN_BYTE_ORDER);
                if (ret)
-                       goto err;
+                       return ret;
                dev_dbg(&pdev->dev, "GPIO registers are BIG endian\n");
        }
 
@@ -380,11 +380,11 @@ static int mpc8xxx_probe(struct platform_device *pdev)
            is_acpi_node(fwnode))
                gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff);
 
-       ret = gpiochip_add_data(gc, mpc8xxx_gc);
+       ret = devm_gpiochip_add_data(&pdev->dev, gc, mpc8xxx_gc);
        if (ret) {
                dev_err(&pdev->dev,
                        "GPIO chip registration failed with status %d\n", ret);
-               goto err;
+               return ret;
        }
 
        mpc8xxx_gc->irqn = platform_get_irq(pdev, 0);
@@ -416,7 +416,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
 
        return 0;
 err:
-       iounmap(mpc8xxx_gc->regs);
+       irq_domain_remove(mpc8xxx_gc->irq);
        return ret;
 }
 
@@ -429,9 +429,6 @@ static int mpc8xxx_remove(struct platform_device *pdev)
                irq_domain_remove(mpc8xxx_gc->irq);
        }
 
-       gpiochip_remove(&mpc8xxx_gc->gc);
-       iounmap(mpc8xxx_gc->regs);
-
        return 0;
 }