mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 16:40:52 +07:00
pinctrl: samsung: Use devres version of gpiochip_add_data
Use devm_gpiochip_add_data to simplify the error path in samsung_gpiolib_register. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
This commit is contained in:
parent
1abd18d1a5
commit
f69ae4f58a
@ -936,20 +936,15 @@ static int samsung_gpiolib_register(struct platform_device *pdev,
|
||||
gc->of_node = bank->of_node;
|
||||
gc->label = bank->name;
|
||||
|
||||
ret = gpiochip_add_data(gc, bank);
|
||||
ret = devm_gpiochip_add_data(&pdev->dev, gc, bank);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register gpio_chip %s, error code: %d\n",
|
||||
gc->label, ret);
|
||||
goto fail;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
for (--i, --bank; i >= 0; --i, --bank)
|
||||
gpiochip_remove(&bank->gpio_chip);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* retrieve the soc specific data */
|
||||
|
Loading…
Reference in New Issue
Block a user