net: dsa: mv88e6xxx: Replace PHY mutex by SMI mutex
[cascardo/linux.git] / drivers / gpio / gpio-adp5588.c
index 3beed6e..d3fe6a6 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;
 }