@@ -1384,18 +1384,15 @@ static void had_process_hot_plug(struct snd_intelhad *intelhaddata)
1384
1384
__func__ , __LINE__ );
1385
1385
spin_unlock_irq (& intelhaddata -> had_spinlock );
1386
1386
1387
- /* Safety check */
1387
+ had_build_channel_allocation_map (intelhaddata );
1388
+
1389
+ /* Report to above ALSA layer */
1388
1390
substream = had_substream_get (intelhaddata );
1389
1391
if (substream ) {
1390
- dev_dbg (intelhaddata -> dev ,
1391
- "Force to stop the active stream by disconnection\n" );
1392
- /* Set runtime->state to hw_params done */
1393
1392
snd_pcm_stop_xrun (substream );
1394
1393
had_substream_put (intelhaddata );
1395
1394
}
1396
1395
1397
- had_build_channel_allocation_map (intelhaddata );
1398
-
1399
1396
snd_jack_report (intelhaddata -> jack , SND_JACK_AVOUT );
1400
1397
}
1401
1398
@@ -1404,14 +1401,11 @@ static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
1404
1401
{
1405
1402
struct snd_pcm_substream * substream ;
1406
1403
1407
- substream = had_substream_get (intelhaddata );
1408
-
1409
1404
spin_lock_irq (& intelhaddata -> had_spinlock );
1410
-
1411
1405
if (!intelhaddata -> connected ) {
1412
1406
dev_dbg (intelhaddata -> dev , "Device already disconnected\n" );
1413
1407
spin_unlock_irq (& intelhaddata -> had_spinlock );
1414
- goto out ;
1408
+ return ;
1415
1409
1416
1410
}
1417
1411
@@ -1424,16 +1418,17 @@ static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
1424
1418
__func__ , __LINE__ );
1425
1419
spin_unlock_irq (& intelhaddata -> had_spinlock );
1426
1420
1421
+ kfree (intelhaddata -> chmap -> chmap );
1422
+ intelhaddata -> chmap -> chmap = NULL ;
1423
+
1427
1424
/* Report to above ALSA layer */
1428
- if (substream )
1425
+ substream = had_substream_get (intelhaddata );
1426
+ if (substream ) {
1429
1427
snd_pcm_stop_xrun (substream );
1428
+ had_substream_put (intelhaddata );
1429
+ }
1430
1430
1431
- out :
1432
1431
snd_jack_report (intelhaddata -> jack , 0 );
1433
- if (substream )
1434
- had_substream_put (intelhaddata );
1435
- kfree (intelhaddata -> chmap -> chmap );
1436
- intelhaddata -> chmap -> chmap = NULL ;
1437
1432
}
1438
1433
1439
1434
/*
0 commit comments