All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Bard Liao <bardliao@realtek.com>, Oder Chiou <oder_chiou@realtek.com>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Regarding ASoC: rt286: Fix the runtime error in the booting
Date: Mon, 05 Oct 2015 18:08:59 +0800	[thread overview]
Message-ID: <1444039739.8819.2.camel@ingics.com> (raw)

Hi Order,
I just notice your patch on the ML:
http://mailman.alsa-project.org/pipermail/alsa-devel/2015-October/098390.html
I didn't subscribe the ML and I'm not in CC so I cannot directly reply to you.

I think you should make a copy of memory for index_cache rather than
directly use the rt286_index_def if the index_cache is necessary.

diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 1fbdb4f..210ab415 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -37,7 +37,7 @@
 #define RT288_VENDOR_ID 0x10ec0288
 
 struct rt286_priv {
-	const struct reg_default *index_cache;
+	struct reg_default *index_cache;
 	int index_cache_size;
 	struct regmap *regmap;
 	struct snd_soc_codec *codec;
@@ -1160,8 +1160,12 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
 		return -ENODEV;
 	}
 
-	rt286->index_cache = rt286_index_def;
 	rt286->index_cache_size = INDEX_CACHE_SIZE;
+	rt286->index_cache = devm_kmalloc(&i2c->dev, INDEX_CACHE_SIZE,
+					  GFP_KERNEL);
+	if (!rt286->index_cache)
+		return -ENOMEM;
+
 	rt286->i2c = i2c;
 	i2c_set_clientdata(i2c, rt286);
 

             reply	other threads:[~2015-10-05 10:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 10:08 Axel Lin [this message]
2015-10-05 10:16 ` Regarding ASoC: rt286: Fix the runtime error in the booting Axel Lin

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=1444039739.8819.2.camel@ingics.com \
    --to=axel.lin@ingics.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.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.