All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: alsa-devel@alsa-project.org
Cc: broonie@kernel.org, lars@metafoo.de, lgirdwood@gmail.com,
	Daniel Mack <zonque@gmail.com>
Subject: [PATCH 1/2] ASoC: codecs: adau1701: refactor firmware loading function
Date: Thu, 23 May 2013 13:58:00 +0200	[thread overview]
Message-ID: <1369310281-4323-1-git-send-email-zonque@gmail.com> (raw)

Pass a struct i2c_client * to adau1701_load_firmware directly to make
the code more readable.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 sound/soc/codecs/adau1701.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index dafdbe8..95e1677 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -180,9 +180,9 @@ static unsigned int adau1701_read(struct snd_soc_codec *codec, unsigned int reg)
 	return value;
 }
 
-static int adau1701_load_firmware(struct snd_soc_codec *codec)
+static int adau1701_load_firmware(struct i2c_client *client)
 {
-	return process_sigma_firmware(codec->control_data, ADAU1701_FIRMWARE);
+	return process_sigma_firmware(client, ADAU1701_FIRMWARE);
 }
 
 static int adau1701_set_capture_pcm_format(struct snd_soc_codec *codec,
@@ -455,10 +455,11 @@ static struct snd_soc_dai_driver adau1701_dai = {
 static int adau1701_probe(struct snd_soc_codec *codec)
 {
 	int ret;
+	struct i2c_client *client = to_i2c_client(codec->dev);
 
-	codec->control_data = to_i2c_client(codec->dev);
+	codec->control_data = client;
 
-	ret = adau1701_load_firmware(codec);
+	ret = adau1701_load_firmware(client);
 	if (ret)
 		dev_warn(codec->dev, "Failed to load firmware\n");
 
-- 
1.8.1.4

             reply	other threads:[~2013-05-23 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 11:58 Daniel Mack [this message]
2013-05-23 11:58 ` [PATCH 2/2] ASoC: codecs: adau1701: add DT bindings Daniel Mack
2013-05-23 13:20   ` Lars-Peter Clausen
2013-05-23 13:13 ` [PATCH 1/2] ASoC: codecs: adau1701: refactor firmware loading function Lars-Peter Clausen
2013-05-23 14:00 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369310281-4323-1-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.