2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 20:53:53 +08:00

pinctrl: sx150x: Unregister the pinctrl on release

There is no matching call to pinctrl_unregister, so switch to the
managed devm_pinctrl_register to clean up properly when done.

Cc: stable@vger.kernel.org
Fixes: 9e80f9064e ("pinctrl: Add SX150X GPIO Extender Pinctrl Driver")
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Peter Rosin 2018-01-17 14:34:21 +01:00 committed by Linus Walleij
parent 119fcf47fd
commit 0657cb50b5

View File

@ -1225,7 +1225,7 @@ static int sx150x_probe(struct i2c_client *client,
pctl->pinctrl_desc.npins = pctl->data->npins; pctl->pinctrl_desc.npins = pctl->data->npins;
pctl->pinctrl_desc.owner = THIS_MODULE; pctl->pinctrl_desc.owner = THIS_MODULE;
pctl->pctldev = pinctrl_register(&pctl->pinctrl_desc, dev, pctl); pctl->pctldev = devm_pinctrl_register(dev, &pctl->pinctrl_desc, pctl);
if (IS_ERR(pctl->pctldev)) { if (IS_ERR(pctl->pctldev)) {
dev_err(dev, "Failed to register pinctrl device\n"); dev_err(dev, "Failed to register pinctrl device\n");
return PTR_ERR(pctl->pctldev); return PTR_ERR(pctl->pctldev);