aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/ucc_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/ucc_uart.c')
-rw-r--r--drivers/serial/ucc_uart.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c
index 0c08f286a2ef..074904912f64 100644
--- a/drivers/serial/ucc_uart.c
+++ b/drivers/serial/ucc_uart.c
@@ -20,6 +20,7 @@
20 20
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/serial.h> 22#include <linux/serial.h>
23#include <linux/slab.h>
23#include <linux/serial_core.h> 24#include <linux/serial_core.h>
24#include <linux/io.h> 25#include <linux/io.h>
25#include <linux/of_platform.h> 26#include <linux/of_platform.h>
@@ -313,7 +314,7 @@ static void qe_uart_stop_tx(struct uart_port *port)
313 * This function will attempt to stuff of all the characters from the 314 * This function will attempt to stuff of all the characters from the
314 * kernel's transmit buffer into TX BDs. 315 * kernel's transmit buffer into TX BDs.
315 * 316 *
316 * A return value of non-zero indicates that it sucessfully stuffed all 317 * A return value of non-zero indicates that it successfully stuffed all
317 * characters from the kernel buffer. 318 * characters from the kernel buffer.
318 * 319 *
319 * A return value of zero indicates that there are still characters in the 320 * A return value of zero indicates that there are still characters in the
@@ -1179,16 +1180,18 @@ static void uart_firmware_cont(const struct firmware *fw, void *context)
1179 1180
1180 if (firmware->header.length != fw->size) { 1181 if (firmware->header.length != fw->size) {
1181 dev_err(dev, "invalid firmware\n"); 1182 dev_err(dev, "invalid firmware\n");
1182 return; 1183 goto out;
1183 } 1184 }
1184 1185
1185 ret = qe_upload_firmware(firmware); 1186 ret = qe_upload_firmware(firmware);
1186 if (ret) { 1187 if (ret) {
1187 dev_err(dev, "could not load firmware\n"); 1188 dev_err(dev, "could not load firmware\n");
1188 return; 1189 goto out;
1189 } 1190 }
1190 1191
1191 firmware_loaded = 1; 1192 firmware_loaded = 1;
1193 out:
1194 release_firmware(fw);
1192} 1195}
1193 1196
1194static int ucc_uart_probe(struct of_device *ofdev, 1197static int ucc_uart_probe(struct of_device *ofdev,
@@ -1247,7 +1250,7 @@ static int ucc_uart_probe(struct of_device *ofdev,
1247 */ 1250 */
1248 ret = request_firmware_nowait(THIS_MODULE, 1251 ret = request_firmware_nowait(THIS_MODULE,
1249 FW_ACTION_HOTPLUG, filename, &ofdev->dev, 1252 FW_ACTION_HOTPLUG, filename, &ofdev->dev,
1250 &ofdev->dev, uart_firmware_cont); 1253 GFP_KERNEL, &ofdev->dev, uart_firmware_cont);
1251 if (ret) { 1254 if (ret) {
1252 dev_err(&ofdev->dev, 1255 dev_err(&ofdev->dev,
1253 "could not load firmware %s\n", 1256 "could not load firmware %s\n",