We can simplify the code a bit with a resource managed variant of
gpiochip_add_data().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
return ret;
}
- ret = gpiochip_add_data(&chip->gpio_chip, chip);
+ ret = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip);
if (ret)
return ret;
ret = max732x_irq_setup(chip, id);
- if (ret) {
- gpiochip_remove(&chip->gpio_chip);
+ if (ret)
return ret;
- }
if (pdata && pdata->setup) {
ret = pdata->setup(client, chip->gpio_chip.base,
}
}
- gpiochip_remove(&chip->gpio_chip);
-
return 0;
}