gpio: move Nomadik GPIO driver to drivers/gpio
[linux-2.6.git] / drivers / gpio / rdc321x-gpio.c
index 46c5519..2762698 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/pci.h>
 #include <linux/gpio.h>
 #include <linux/mfd/rdc321x.h>
+#include <linux/slab.h>
 
 struct rdc321x_gpio {
        spinlock_t              lock;
@@ -72,7 +73,7 @@ static void rdc_gpio_set_value_impl(struct gpio_chip *chip,
                gpch->data_reg[reg] &= ~(1 << (gpio & 0x1f));
 
        pci_write_config_dword(gpch->sb_pdev,
-                       reg ? gpch->reg1_data_base : gpch->reg2_data_base,
+                       reg ? gpch->reg2_data_base : gpch->reg1_data_base,
                        gpch->data_reg[reg]);
 }
 
@@ -146,7 +147,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
 
-       r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpio-reg1");
+       r = platform_get_resource_byname(pdev, IORESOURCE_IO, "gpio-reg1");
        if (!r) {
                dev_err(&pdev->dev, "failed to get gpio-reg1 resource\n");
                err = -ENODEV;
@@ -158,7 +159,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev)
        rdc321x_gpio_dev->reg1_ctrl_base = r->start;
        rdc321x_gpio_dev->reg1_data_base = r->start + 0x4;
 
-       r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpio-reg2");
+       r = platform_get_resource_byname(pdev, IORESOURCE_IO, "gpio-reg2");
        if (!r) {
                dev_err(&pdev->dev, "failed to get gpio-reg2 resource\n");
                err = -ENODEV;