Commit f39f54af authored by Jingoo Han's avatar Jingoo Han Committed by Linus Walleij

gpio: pcf857x: use devm_kzalloc()

Use devm_kzalloc() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <>
Signed-off-by: Linus Walleij's avatarLinus Walleij <>
parent 632d8e55
......@@ -268,7 +268,7 @@ static int pcf857x_probe(struct i2c_client *client,
/* Allocate, initialize, and register this gpio_chip. */
gpio = kzalloc(sizeof *gpio, GFP_KERNEL);
gpio = devm_kzalloc(&client->dev, sizeof(*gpio), GFP_KERNEL);
if (!gpio)
return -ENOMEM;
......@@ -391,7 +391,6 @@ static int pcf857x_probe(struct i2c_client *client,
if (pdata && client->irq)
return status;
......@@ -416,9 +415,7 @@ static int pcf857x_remove(struct i2c_client *client)
status = gpiochip_remove(&gpio->chip);
if (status == 0)
if (status)
dev_err(&client->dev, "%s --> %d\n", "remove", status);
return status;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment