Merge remote branch 'origin/master' into drm-intel-next
[safe/jmp/linux-2.6] / drivers / gpio / pcf857x.c
index 4bc2070..29f19ce 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/slab.h>
+#include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pcf857x.h>
 
-#include <asm/gpio.h>
-
 
 static const struct i2c_device_id pcf857x_id[] = {
        { "pcf8574", 8 },
+       { "pcf8574a", 8 },
        { "pca8574", 8 },
        { "pca9670", 8 },
        { "pca9672", 8 },
@@ -188,8 +188,10 @@ static int pcf857x_probe(struct i2c_client *client,
        int                             status;
 
        pdata = client->dev.platform_data;
-       if (!pdata)
-               return -ENODEV;
+       if (!pdata) {
+               dev_dbg(&client->dev, "no platform data\n");
+               return -EINVAL;
+       }
 
        /* Allocate, initialize, and register this gpio_chip. */
        gpio = kzalloc(sizeof *gpio, GFP_KERNEL);
@@ -248,8 +250,10 @@ static int pcf857x_probe(struct i2c_client *client,
                else
                        status = i2c_read_le16(client);
 
-       } else
-               status = -ENODEV;
+       } else {
+               dev_dbg(&client->dev, "unsupported number of gpios\n");
+               status = -EINVAL;
+       }
 
        if (status < 0)
                goto fail;