diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2014-02-10 13:18:33 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-13 12:34:48 -0500 |
commit | 0fbae8874eea124591aee10efae98d244a2d072d (patch) | |
tree | d05e744371ca02e1a6b3d3d370a8109511c967e4 /drivers/tty/serial/max310x.c | |
parent | dba29a2894771562d265232ae4b61f0310bab1f5 (diff) |
serial: max310x: Add missing mutex_destroy() on driver exit
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/max310x.c')
-rw-r--r-- | drivers/tty/serial/max310x.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 2a12cbcbf388..c180576546ed 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -1134,8 +1134,6 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, | |||
1134 | s->devtype = devtype; | 1134 | s->devtype = devtype; |
1135 | dev_set_drvdata(dev, s); | 1135 | dev_set_drvdata(dev, s); |
1136 | 1136 | ||
1137 | mutex_init(&s->mutex); | ||
1138 | |||
1139 | /* Check device to ensure we are talking to what we expect */ | 1137 | /* Check device to ensure we are talking to what we expect */ |
1140 | ret = devtype->detect(dev); | 1138 | ret = devtype->detect(dev); |
1141 | if (ret) | 1139 | if (ret) |
@@ -1193,6 +1191,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, | |||
1193 | goto out_uart; | 1191 | goto out_uart; |
1194 | #endif | 1192 | #endif |
1195 | 1193 | ||
1194 | mutex_init(&s->mutex); | ||
1195 | |||
1196 | for (i = 0; i < devtype->nr; i++) { | 1196 | for (i = 0; i < devtype->nr; i++) { |
1197 | /* Initialize port data */ | 1197 | /* Initialize port data */ |
1198 | s->p[i].port.line = i; | 1198 | s->p[i].port.line = i; |
@@ -1233,6 +1233,8 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, | |||
1233 | 1233 | ||
1234 | dev_err(dev, "Unable to reguest IRQ %i\n", irq); | 1234 | dev_err(dev, "Unable to reguest IRQ %i\n", irq); |
1235 | 1235 | ||
1236 | mutex_destroy(&s->mutex); | ||
1237 | |||
1236 | #ifdef CONFIG_GPIOLIB | 1238 | #ifdef CONFIG_GPIOLIB |
1237 | WARN_ON(gpiochip_remove(&s->gpio)); | 1239 | WARN_ON(gpiochip_remove(&s->gpio)); |
1238 | #endif | 1240 | #endif |
@@ -1264,6 +1266,7 @@ static int max310x_remove(struct device *dev) | |||
1264 | s->devtype->power(&s->p[i].port, 0); | 1266 | s->devtype->power(&s->p[i].port, 0); |
1265 | } | 1267 | } |
1266 | 1268 | ||
1269 | mutex_destroy(&s->mutex); | ||
1267 | uart_unregister_driver(&s->uart); | 1270 | uart_unregister_driver(&s->uart); |
1268 | clk_disable_unprepare(s->clk); | 1271 | clk_disable_unprepare(s->clk); |
1269 | 1272 | ||