mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 05:34:00 +08:00
pinctrl: xway: use devm_gpiochip_add_data()
Avoid a gpiochip_free() and use standard functions. Cc: John Crispin <blogic@openwrt.org> Cc: Pramod Gurav <pramod.gurav@smartplayin.com> Cc: Martin Schiller <mschiller@tdt.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
8c7a92dad1
commit
86ede3d41b
@ -1724,9 +1724,9 @@ static int pinmux_xway_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
xway_pctrl_desc.pins = xway_info.pads;
|
xway_pctrl_desc.pins = xway_info.pads;
|
||||||
|
|
||||||
/* load the gpio chip */
|
/* register the gpio chip */
|
||||||
xway_chip.parent = &pdev->dev;
|
xway_chip.parent = &pdev->dev;
|
||||||
ret = gpiochip_add(&xway_chip);
|
ret = devm_gpiochip_add_data(&pdev->dev, &xway_chip, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "Failed to register gpio chip\n");
|
dev_err(&pdev->dev, "Failed to register gpio chip\n");
|
||||||
return ret;
|
return ret;
|
||||||
@ -1749,7 +1749,6 @@ static int pinmux_xway_probe(struct platform_device *pdev)
|
|||||||
/* register with the generic lantiq layer */
|
/* register with the generic lantiq layer */
|
||||||
ret = ltq_pinctrl_register(pdev, &xway_info);
|
ret = ltq_pinctrl_register(pdev, &xway_info);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
gpiochip_remove(&xway_chip);
|
|
||||||
dev_err(&pdev->dev, "Failed to register pinctrl driver\n");
|
dev_err(&pdev->dev, "Failed to register pinctrl driver\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user