Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 108145a6 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branch 'asoc/topic/warn' into asoc-next

parents 022aa51e bf4edea8
Loading
Loading
Loading
Loading
+20 −12
Original line number Diff line number Diff line
@@ -179,8 +179,9 @@ static inline int sport_hook_rx_dummy(struct sport_device *sport)
	struct dmasg *desc, temp_desc;
	unsigned long flags;

	BUG_ON(sport->dummy_rx_desc == NULL);
	BUG_ON(sport->curr_rx_desc == sport->dummy_rx_desc);
	if (WARN_ON(!sport->dummy_rx_desc) ||
	    WARN_ON(sport->curr_rx_desc == sport->dummy_rx_desc))
		return -EINVAL;

	/* Maybe the dummy buffer descriptor ring is damaged */
	sport->dummy_rx_desc->next_desc_addr = sport->dummy_rx_desc + 1;
@@ -250,8 +251,9 @@ int sport_rx_start(struct sport_device *sport)
		return -EBUSY;
	if (sport->tx_run) {
		/* tx is running, rx is not running */
		BUG_ON(sport->dma_rx_desc == NULL);
		BUG_ON(sport->curr_rx_desc != sport->dummy_rx_desc);
		if (WARN_ON(!sport->dma_rx_desc) ||
		    WARN_ON(sport->curr_rx_desc != sport->dummy_rx_desc))
			return -EINVAL;
		local_irq_save(flags);
		while ((get_dma_curr_desc_ptr(sport->dma_rx_chan) -
			sizeof(struct dmasg)) != sport->dummy_rx_desc)
@@ -298,8 +300,9 @@ static inline int sport_hook_tx_dummy(struct sport_device *sport)
	struct dmasg *desc, temp_desc;
	unsigned long flags;

	BUG_ON(sport->dummy_tx_desc == NULL);
	BUG_ON(sport->curr_tx_desc == sport->dummy_tx_desc);
	if (WARN_ON(!sport->dummy_tx_desc) ||
	    WARN_ON(sport->curr_tx_desc == sport->dummy_tx_desc))
		return -EINVAL;

	sport->dummy_tx_desc->next_desc_addr = sport->dummy_tx_desc + 1;

@@ -331,8 +334,9 @@ int sport_tx_start(struct sport_device *sport)
	if (sport->tx_run)
		return -EBUSY;
	if (sport->rx_run) {
		BUG_ON(sport->dma_tx_desc == NULL);
		BUG_ON(sport->curr_tx_desc != sport->dummy_tx_desc);
		if (WARN_ON(!sport->dma_tx_desc) ||
		    WARN_ON(sport->curr_tx_desc != sport->dummy_tx_desc))
			return -EINVAL;
		/* Hook the normal buffer descriptor */
		local_irq_save(flags);
		while ((get_dma_curr_desc_ptr(sport->dma_tx_chan) -
@@ -767,7 +771,8 @@ static irqreturn_t err_handler(int irq, void *dev_id)
int sport_set_rx_callback(struct sport_device *sport,
		       void (*rx_callback)(void *), void *rx_data)
{
	BUG_ON(rx_callback == NULL);
	if (WARN_ON(!rx_callback))
		return -EINVAL;
	sport->rx_callback = rx_callback;
	sport->rx_data = rx_data;

@@ -778,7 +783,8 @@ EXPORT_SYMBOL(sport_set_rx_callback);
int sport_set_tx_callback(struct sport_device *sport,
		void (*tx_callback)(void *), void *tx_data)
{
	BUG_ON(tx_callback == NULL);
	if (WARN_ON(!tx_callback))
		return -EINVAL;
	sport->tx_callback = tx_callback;
	sport->tx_data = tx_data;

@@ -789,7 +795,8 @@ EXPORT_SYMBOL(sport_set_tx_callback);
int sport_set_err_callback(struct sport_device *sport,
		void (*err_callback)(void *), void *err_data)
{
	BUG_ON(err_callback == NULL);
	if (WARN_ON(!err_callback))
		return -EINVAL;
	sport->err_callback = err_callback;
	sport->err_data = err_data;

@@ -856,7 +863,8 @@ struct sport_device *sport_init(struct platform_device *pdev,

	param.wdsize = wdsize;
	param.dummy_count = dummy_count;
	BUG_ON(param.wdsize == 0 || param.dummy_count == 0);
	if (WARN_ON(param.wdsize == 0 || param.dummy_count == 0))
		return NULL;

	ret = sport_config_pdev(pdev, &param);
	if (ret)
+5 −3
Original line number Diff line number Diff line
@@ -568,8 +568,9 @@ static void m98088_eq_band(struct snd_soc_codec *codec, unsigned int dai,
       unsigned int eq_reg;
       unsigned int i;

       BUG_ON(band > 4);
       BUG_ON(dai > 1);
	if (WARN_ON(band > 4) ||
	    WARN_ON(dai > 1))
		return;

       /* Load the base register address */
       eq_reg = dai ? M98088_REG_84_DAI2_EQ_BASE : M98088_REG_52_DAI1_EQ_BASE;
@@ -909,7 +910,8 @@ static int max98088_line_pga(struct snd_soc_dapm_widget *w,
       struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
       u8 *state;

       BUG_ON(!((channel == 1) || (channel == 2)));
	if (WARN_ON(!(channel == 1 || channel == 2)))
		return -EINVAL;

       switch (line) {
       case LINE_INA:
+10 −6
Original line number Diff line number Diff line
@@ -516,8 +516,9 @@ static void m98095_eq_band(struct snd_soc_codec *codec, unsigned int dai,
	unsigned int eq_reg;
	unsigned int i;

	BUG_ON(band > 4);
	BUG_ON(dai > 1);
	if (WARN_ON(band > 4) ||
	    WARN_ON(dai > 1))
		return;

	/* Load the base register address */
	eq_reg = dai ? M98095_142_DAI2_EQ_BASE : M98095_110_DAI1_EQ_BASE;
@@ -541,8 +542,9 @@ static void m98095_biquad_band(struct snd_soc_codec *codec, unsigned int dai,
	unsigned int bq_reg;
	unsigned int i;

	BUG_ON(band > 1);
	BUG_ON(dai > 1);
	if (WARN_ON(band > 1) ||
	    WARN_ON(dai > 1))
		return;

	/* Load the base register address */
	bq_reg = dai ? M98095_17E_DAI2_BQ_BASE : M98095_174_DAI1_BQ_BASE;
@@ -890,7 +892,8 @@ static int max98095_line_pga(struct snd_soc_dapm_widget *w,
	struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
	u8 *state;

	BUG_ON(!((channel == 1) || (channel == 2)));
	if (WARN_ON(!(channel == 1 || channel == 2)))
		return -EINVAL;

	state = &max98095->lin_state;

@@ -1740,7 +1743,8 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol,
	int fs, best, best_val, i;
	int regmask, regsave;

	BUG_ON(channel > 1);
	if (WARN_ON(channel > 1))
		return -EINVAL;

	if (!pdata || !max98095->eq_textcnt)
		return 0;
+14 −7
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@ static int tpa6130a2_i2c_read(int reg)
	struct tpa6130a2_data *data;
	int val;

	BUG_ON(tpa6130a2_client == NULL);
	if (WARN_ON(!tpa6130a2_client))
		return -EINVAL;
	data = i2c_get_clientdata(tpa6130a2_client);

	/* If powered off, return the cached value */
@@ -78,7 +79,8 @@ static int tpa6130a2_i2c_write(int reg, u8 value)
	struct tpa6130a2_data *data;
	int val = 0;

	BUG_ON(tpa6130a2_client == NULL);
	if (WARN_ON(!tpa6130a2_client))
		return -EINVAL;
	data = i2c_get_clientdata(tpa6130a2_client);

	if (data->power_state) {
@@ -99,7 +101,8 @@ static u8 tpa6130a2_read(int reg)
{
	struct tpa6130a2_data *data;

	BUG_ON(tpa6130a2_client == NULL);
	if (WARN_ON(!tpa6130a2_client))
		return 0;
	data = i2c_get_clientdata(tpa6130a2_client);

	return data->regs[reg];
@@ -110,7 +113,8 @@ static int tpa6130a2_initialize(void)
	struct tpa6130a2_data *data;
	int i, ret = 0;

	BUG_ON(tpa6130a2_client == NULL);
	if (WARN_ON(!tpa6130a2_client))
		return -EINVAL;
	data = i2c_get_clientdata(tpa6130a2_client);

	for (i = 1; i < TPA6130A2_REG_VERSION; i++) {
@@ -128,7 +132,8 @@ static int tpa6130a2_power(u8 power)
	u8	val;
	int	ret = 0;

	BUG_ON(tpa6130a2_client == NULL);
	if (WARN_ON(!tpa6130a2_client))
		return -EINVAL;
	data = i2c_get_clientdata(tpa6130a2_client);

	mutex_lock(&data->mutex);
@@ -194,7 +199,8 @@ static int tpa6130a2_get_volsw(struct snd_kcontrol *kcontrol,
	unsigned int mask = (1 << fls(max)) - 1;
	unsigned int invert = mc->invert;

	BUG_ON(tpa6130a2_client == NULL);
	if (WARN_ON(!tpa6130a2_client))
		return -EINVAL;
	data = i2c_get_clientdata(tpa6130a2_client);

	mutex_lock(&data->mutex);
@@ -224,7 +230,8 @@ static int tpa6130a2_put_volsw(struct snd_kcontrol *kcontrol,
	unsigned int val = (ucontrol->value.integer.value[0] & mask);
	unsigned int val_reg;

	BUG_ON(tpa6130a2_client == NULL);
	if (WARN_ON(!tpa6130a2_client))
		return -EINVAL;
	data = i2c_get_clientdata(tpa6130a2_client);

	if (invert)
+2 −1
Original line number Diff line number Diff line
@@ -372,7 +372,8 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
	offset = 0;
	dsp = inforec->dsp_target;
	wm0010->boot_failed = false;
	BUG_ON(!list_empty(&xfer_list));
	if (WARN_ON(!list_empty(&xfer_list)))
		return -EINVAL;
	init_completion(&done);

	/* First record should be INFO */
Loading