@@ -531,7 +531,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip,
531531 unsigned long flags ;
532532 int full_calib = 1 ;
533533
534- down (& chip -> mce_mutex );
534+ mutex_lock (& chip -> mce_mutex );
535535 snd_cs4231_calibrate_mute (chip , 1 );
536536 if (chip -> hardware == CS4231_HW_CS4231A ||
537537 (chip -> hardware & CS4231_HW_CS4232_MASK )) {
@@ -560,7 +560,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip,
560560 snd_cs4231_mce_down (chip );
561561 }
562562 snd_cs4231_calibrate_mute (chip , 0 );
563- up (& chip -> mce_mutex );
563+ mutex_unlock (& chip -> mce_mutex );
564564}
565565
566566static void snd_cs4231_capture_format (struct snd_cs4231 * chip ,
@@ -570,7 +570,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
570570 unsigned long flags ;
571571 int full_calib = 1 ;
572572
573- down (& chip -> mce_mutex );
573+ mutex_lock (& chip -> mce_mutex );
574574 snd_cs4231_calibrate_mute (chip , 1 );
575575 if (chip -> hardware == CS4231_HW_CS4231A ||
576576 (chip -> hardware & CS4231_HW_CS4232_MASK )) {
@@ -603,7 +603,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
603603 snd_cs4231_mce_down (chip );
604604 }
605605 snd_cs4231_calibrate_mute (chip , 0 );
606- up (& chip -> mce_mutex );
606+ mutex_unlock (& chip -> mce_mutex );
607607}
608608
609609/*
@@ -709,15 +709,15 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
709709{
710710 unsigned long flags ;
711711
712- down (& chip -> open_mutex );
712+ mutex_lock (& chip -> open_mutex );
713713 if ((chip -> mode & mode ) ||
714714 ((chip -> mode & CS4231_MODE_OPEN ) && chip -> single_dma )) {
715- up (& chip -> open_mutex );
715+ mutex_unlock (& chip -> open_mutex );
716716 return - EAGAIN ;
717717 }
718718 if (chip -> mode & CS4231_MODE_OPEN ) {
719719 chip -> mode |= mode ;
720- up (& chip -> open_mutex );
720+ mutex_unlock (& chip -> open_mutex );
721721 return 0 ;
722722 }
723723 /* ok. now enable and ack CODEC IRQ */
@@ -737,18 +737,18 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
737737 spin_unlock_irqrestore (& chip -> reg_lock , flags );
738738
739739 chip -> mode = mode ;
740- up (& chip -> open_mutex );
740+ mutex_unlock (& chip -> open_mutex );
741741 return 0 ;
742742}
743743
744744static void snd_cs4231_close (struct snd_cs4231 * chip , unsigned int mode )
745745{
746746 unsigned long flags ;
747747
748- down (& chip -> open_mutex );
748+ mutex_lock (& chip -> open_mutex );
749749 chip -> mode &= ~mode ;
750750 if (chip -> mode & CS4231_MODE_OPEN ) {
751- up (& chip -> open_mutex );
751+ mutex_unlock (& chip -> open_mutex );
752752 return ;
753753 }
754754 snd_cs4231_calibrate_mute (chip , 1 );
@@ -785,7 +785,7 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode)
785785 snd_cs4231_calibrate_mute (chip , 0 );
786786
787787 chip -> mode = 0 ;
788- up (& chip -> open_mutex );
788+ mutex_unlock (& chip -> open_mutex );
789789}
790790
791791/*
@@ -1408,8 +1408,8 @@ static int snd_cs4231_new(struct snd_card *card,
14081408 chip -> hwshare = hwshare ;
14091409
14101410 spin_lock_init (& chip -> reg_lock );
1411- init_MUTEX (& chip -> mce_mutex );
1412- init_MUTEX (& chip -> open_mutex );
1411+ mutex_init (& chip -> mce_mutex );
1412+ mutex_init (& chip -> open_mutex );
14131413 chip -> card = card ;
14141414 chip -> rate_constraint = snd_cs4231_xrate ;
14151415 chip -> set_playback_format = snd_cs4231_playback_format ;
@@ -1538,8 +1538,8 @@ int snd_cs4231_pcm(struct snd_cs4231 *chip, int device, struct snd_pcm **rpcm)
15381538 return err ;
15391539
15401540 spin_lock_init (& chip -> reg_lock );
1541- init_MUTEX (& chip -> mce_mutex );
1542- init_MUTEX (& chip -> open_mutex );
1541+ mutex_init (& chip -> mce_mutex );
1542+ mutex_init (& chip -> open_mutex );
15431543
15441544 snd_pcm_set_ops (pcm , SNDRV_PCM_STREAM_PLAYBACK , & snd_cs4231_playback_ops );
15451545 snd_pcm_set_ops (pcm , SNDRV_PCM_STREAM_CAPTURE , & snd_cs4231_capture_ops );
0 commit comments