Skip to content

Commit

Permalink
ASoC: twl4030: Pass the twl4030_priv directly to twl4030_can_write_to…
Browse files Browse the repository at this point in the history
…_chip()

To avoid another lookup for the twl4030_priv in there.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Jan 8, 2014
1 parent a450aa6 commit b703b50
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ static unsigned int twl4030_read(struct snd_soc_codec *codec, unsigned int reg)
return value;
}

static bool twl4030_can_write_to_chip(struct snd_soc_codec *codec,
static bool twl4030_can_write_to_chip(struct twl4030_priv *twl4030,
unsigned int reg)
{
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
bool write_to_reg = false;

/* Decide if the given register can be written */
Expand Down Expand Up @@ -171,7 +170,7 @@ static int twl4030_write(struct snd_soc_codec *codec, unsigned int reg,
break;
}

if (twl4030_can_write_to_chip(codec, reg))
if (twl4030_can_write_to_chip(twl4030, reg))
return twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, value, reg);

return 0;
Expand Down

0 comments on commit b703b50

Please sign in to comment.