Merge tag 'chrome-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof...
[deliverable/linux.git] / drivers / gpio / gpio-adp5588.c
index 3beed6ea8c6568fbd4d560e5dd2da8f6102ba167..d3fe6a6776daaa8c43023daba09f3008187c471d 100644 (file)
@@ -367,7 +367,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
        struct gpio_chip *gc;
        int ret, i, revid;
 
-       if (pdata == NULL) {
+       if (!pdata) {
                dev_err(&client->dev, "missing platform data\n");
                return -ENODEV;
        }
@@ -378,8 +378,8 @@ static int adp5588_gpio_probe(struct i2c_client *client,
                return -EIO;
        }
 
-       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
-       if (dev == NULL)
+       dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL);
+       if (!dev)
                return -ENOMEM;
 
        dev->client = client;
@@ -446,7 +446,6 @@ static int adp5588_gpio_probe(struct i2c_client *client,
 err_irq:
        adp5588_irq_teardown(dev);
 err:
-       kfree(dev);
        return ret;
 }
 
@@ -472,7 +471,6 @@ static int adp5588_gpio_remove(struct i2c_client *client)
 
        gpiochip_remove(&dev->gpio_chip);
 
-       kfree(dev);
        return 0;
 }
 
This page took 0.045972 seconds and 5 git commands to generate.