Commit 0fbae887 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Greg Kroah-Hartman

serial: max310x: Add missing mutex_destroy() on driver exit

Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dba29a28
...@@ -1134,8 +1134,6 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, ...@@ -1134,8 +1134,6 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
s->devtype = devtype; s->devtype = devtype;
dev_set_drvdata(dev, s); dev_set_drvdata(dev, s);
mutex_init(&s->mutex);
/* Check device to ensure we are talking to what we expect */ /* Check device to ensure we are talking to what we expect */
ret = devtype->detect(dev); ret = devtype->detect(dev);
if (ret) if (ret)
...@@ -1193,6 +1191,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, ...@@ -1193,6 +1191,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
goto out_uart; goto out_uart;
#endif #endif
mutex_init(&s->mutex);
for (i = 0; i < devtype->nr; i++) { for (i = 0; i < devtype->nr; i++) {
/* Initialize port data */ /* Initialize port data */
s->p[i].port.line = i; s->p[i].port.line = i;
...@@ -1233,6 +1233,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, ...@@ -1233,6 +1233,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
dev_err(dev, "Unable to reguest IRQ %i\n", irq); dev_err(dev, "Unable to reguest IRQ %i\n", irq);
mutex_destroy(&s->mutex);
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
WARN_ON(gpiochip_remove(&s->gpio)); WARN_ON(gpiochip_remove(&s->gpio));
#endif #endif
...@@ -1264,6 +1266,7 @@ static int max310x_remove(struct device *dev) ...@@ -1264,6 +1266,7 @@ static int max310x_remove(struct device *dev)
s->devtype->power(&s->p[i].port, 0); s->devtype->power(&s->p[i].port, 0);
} }
mutex_destroy(&s->mutex);
uart_unregister_driver(&s->uart); uart_unregister_driver(&s->uart);
clk_disable_unprepare(s->clk); clk_disable_unprepare(s->clk);
......
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