]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/drivers/vx/vx_uer.c
ALSA: Kill snd_assert() in other places
[linux-2.6-omap-h63xx.git] / sound / drivers / vx / vx_uer.c
index 4fc38bde34f475e2b6742fed924fc5f5e8d74322..0e1ba9b47904aa95de29dfe18f6aa6324aa8a3a7 100644 (file)
@@ -20,7 +20,6 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <sound/driver.h>
 #include <linux/delay.h>
 #include <sound/core.h>
 #include <sound/vx_core.h>
@@ -31,7 +30,7 @@
  * vx_modify_board_clock - tell the board that its clock has been modified
  * @sync: DSP needs to resynchronize its FIFO
  */
-static int vx_modify_board_clock(vx_core_t *chip, int sync)
+static int vx_modify_board_clock(struct vx_core *chip, int sync)
 {
        struct vx_rmh rmh;
 
@@ -45,7 +44,7 @@ static int vx_modify_board_clock(vx_core_t *chip, int sync)
 /*
  * vx_modify_board_inputs - resync audio inputs
  */
-static int vx_modify_board_inputs(vx_core_t *chip)
+static int vx_modify_board_inputs(struct vx_core *chip)
 {
        struct vx_rmh rmh;
 
@@ -59,7 +58,7 @@ static int vx_modify_board_inputs(vx_core_t *chip)
  * @index: the bit index
  * returns 0 or 1.
  */
-static int vx_read_one_cbit(vx_core_t *chip, int index)
+static int vx_read_one_cbit(struct vx_core *chip, int index)
 {
        unsigned long flags;
        int val;
@@ -82,7 +81,7 @@ static int vx_read_one_cbit(vx_core_t *chip, int index)
  * @index: the bit index
  * @val: bit value, 0 or 1
  */
-static void vx_write_one_cbit(vx_core_t *chip, int index, int val)
+static void vx_write_one_cbit(struct vx_core *chip, int index, int val)
 {
        unsigned long flags;
        val = !!val;    /* 0 or 1 */
@@ -104,7 +103,7 @@ static void vx_write_one_cbit(vx_core_t *chip, int index, int val)
  * returns the frequency of UER, or 0 if not sync,
  * or a negative error code.
  */
-static int vx_read_uer_status(vx_core_t *chip, int *mode)
+static int vx_read_uer_status(struct vx_core *chip, int *mode)
 {
        int val, freq;
 
@@ -160,17 +159,19 @@ static int vx_read_uer_status(vx_core_t *chip, int *mode)
  *    default        : HexFreq = (dword) ((double) 28224000 / (double) (Frequency*4)) - 0x000001FF
  */
 
-static int vx_calc_clock_from_freq(vx_core_t *chip, int freq)
+static int vx_calc_clock_from_freq(struct vx_core *chip, int freq)
 {
        int hexfreq;
 
-       snd_assert(freq > 0, return 0);
+       if (snd_BUG_ON(freq <= 0))
+               return 0;
 
        hexfreq = (28224000 * 10) / freq;
        hexfreq = (hexfreq + 5) / 10;
 
        /* max freq = 55125 Hz */
-       snd_assert(hexfreq > 0x00000200, return 0);
+       if (snd_BUG_ON(hexfreq <= 0x00000200))
+               return 0;
 
        if (hexfreq <= 0x03ff)
                return hexfreq - 0x00000201;
@@ -187,7 +188,7 @@ static int vx_calc_clock_from_freq(vx_core_t *chip, int freq)
  * vx_change_clock_source - change the clock source
  * @source: the new source
  */
-static void vx_change_clock_source(vx_core_t *chip, int source)
+static void vx_change_clock_source(struct vx_core *chip, int source)
 {
        unsigned long flags;
 
@@ -205,7 +206,7 @@ static void vx_change_clock_source(vx_core_t *chip, int source)
 /*
  * set the internal clock
  */
-void vx_set_internal_clock(vx_core_t *chip, unsigned int freq)
+void vx_set_internal_clock(struct vx_core *chip, unsigned int freq)
 {
        int clock;
        unsigned long flags;
@@ -228,7 +229,7 @@ void vx_set_internal_clock(vx_core_t *chip, unsigned int freq)
  * set the iec958 status bits
  * @bits: 32-bit status bits
  */
-void vx_set_iec958_status(vx_core_t *chip, unsigned int bits)
+void vx_set_iec958_status(struct vx_core *chip, unsigned int bits)
 {
        int i;
 
@@ -243,7 +244,7 @@ void vx_set_iec958_status(vx_core_t *chip, unsigned int bits)
 /*
  * vx_set_clock - change the clock and audio source if necessary
  */
-int vx_set_clock(vx_core_t *chip, unsigned int freq)
+int vx_set_clock(struct vx_core *chip, unsigned int freq)
 {
        int src_changed = 0;
 
@@ -285,7 +286,7 @@ int vx_set_clock(vx_core_t *chip, unsigned int freq)
 /*
  * vx_change_frequency - called from interrupt handler
  */
-int vx_change_frequency(vx_core_t *chip)
+int vx_change_frequency(struct vx_core *chip)
 {
        int freq;