@@ -1276,7 +1276,6 @@ static void rx_dma_timer_init(struct lpuart_port *sport)
1276
1276
static int lpuart_startup (struct uart_port * port )
1277
1277
{
1278
1278
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
1279
- int ret ;
1280
1279
unsigned long flags ;
1281
1280
unsigned char temp ;
1282
1281
@@ -1291,11 +1290,6 @@ static int lpuart_startup(struct uart_port *port)
1291
1290
sport -> rxfifo_size = 0x1 << (((temp >> UARTPFIFO_RXSIZE_OFF ) &
1292
1291
UARTPFIFO_FIFOSIZE_MASK ) + 1 );
1293
1292
1294
- ret = devm_request_irq (port -> dev , port -> irq , lpuart_int , 0 ,
1295
- DRIVER_NAME , sport );
1296
- if (ret )
1297
- return ret ;
1298
-
1299
1293
spin_lock_irqsave (& sport -> port .lock , flags );
1300
1294
1301
1295
lpuart_setup_watermark (sport );
@@ -1333,7 +1327,6 @@ static int lpuart_startup(struct uart_port *port)
1333
1327
static int lpuart32_startup (struct uart_port * port )
1334
1328
{
1335
1329
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
1336
- int ret ;
1337
1330
unsigned long flags ;
1338
1331
unsigned long temp ;
1339
1332
@@ -1346,11 +1339,6 @@ static int lpuart32_startup(struct uart_port *port)
1346
1339
sport -> rxfifo_size = 0x1 << (((temp >> UARTFIFO_RXSIZE_OFF ) &
1347
1340
UARTFIFO_FIFOSIZE_MASK ) - 1 );
1348
1341
1349
- ret = devm_request_irq (port -> dev , port -> irq , lpuart32_int , 0 ,
1350
- DRIVER_NAME , sport );
1351
- if (ret )
1352
- return ret ;
1353
-
1354
1342
spin_lock_irqsave (& sport -> port .lock , flags );
1355
1343
1356
1344
lpuart32_setup_watermark (sport );
@@ -1380,8 +1368,6 @@ static void lpuart_shutdown(struct uart_port *port)
1380
1368
1381
1369
spin_unlock_irqrestore (& port -> lock , flags );
1382
1370
1383
- devm_free_irq (port -> dev , port -> irq , sport );
1384
-
1385
1371
if (sport -> lpuart_dma_rx_use ) {
1386
1372
del_timer_sync (& sport -> lpuart_timer );
1387
1373
lpuart_dma_rx_free (& sport -> port );
@@ -1400,7 +1386,6 @@ static void lpuart_shutdown(struct uart_port *port)
1400
1386
1401
1387
static void lpuart32_shutdown (struct uart_port * port )
1402
1388
{
1403
- struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
1404
1389
unsigned long temp ;
1405
1390
unsigned long flags ;
1406
1391
@@ -1413,8 +1398,6 @@ static void lpuart32_shutdown(struct uart_port *port)
1413
1398
lpuart32_write (port , temp , UARTCTRL );
1414
1399
1415
1400
spin_unlock_irqrestore (& port -> lock , flags );
1416
-
1417
- devm_free_irq (port -> dev , port -> irq , sport );
1418
1401
}
1419
1402
1420
1403
static void
@@ -2212,16 +2195,22 @@ static int lpuart_probe(struct platform_device *pdev)
2212
2195
2213
2196
platform_set_drvdata (pdev , & sport -> port );
2214
2197
2215
- if (lpuart_is_32 (sport ))
2198
+ if (lpuart_is_32 (sport )) {
2216
2199
lpuart_reg .cons = LPUART32_CONSOLE ;
2217
- else
2200
+ ret = devm_request_irq (& pdev -> dev , sport -> port .irq , lpuart32_int , 0 ,
2201
+ DRIVER_NAME , sport );
2202
+ } else {
2218
2203
lpuart_reg .cons = LPUART_CONSOLE ;
2204
+ ret = devm_request_irq (& pdev -> dev , sport -> port .irq , lpuart_int , 0 ,
2205
+ DRIVER_NAME , sport );
2206
+ }
2207
+
2208
+ if (ret )
2209
+ goto failed_irq_request ;
2219
2210
2220
2211
ret = uart_add_one_port (& lpuart_reg , & sport -> port );
2221
- if (ret ) {
2222
- clk_disable_unprepare (sport -> clk );
2223
- return ret ;
2224
- }
2212
+ if (ret )
2213
+ goto failed_attach_port ;
2225
2214
2226
2215
sport -> dma_tx_chan = dma_request_slave_channel (sport -> port .dev , "tx" );
2227
2216
if (!sport -> dma_tx_chan )
@@ -2240,6 +2229,11 @@ static int lpuart_probe(struct platform_device *pdev)
2240
2229
}
2241
2230
2242
2231
return 0 ;
2232
+
2233
+ failed_attach_port :
2234
+ failed_irq_request :
2235
+ clk_disable_unprepare (sport -> clk );
2236
+ return ret ;
2243
2237
}
2244
2238
2245
2239
static int lpuart_remove (struct platform_device * pdev )
0 commit comments