From patchwork Mon Oct 5 10:08:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 7325851 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A8939F302 for ; Mon, 5 Oct 2015 10:10:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F03DC2077C for ; Mon, 5 Oct 2015 10:10:08 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id ADF21206B8 for ; Mon, 5 Oct 2015 10:10:07 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B09702604DF; Mon, 5 Oct 2015 12:10:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 39EA5260504; Mon, 5 Oct 2015 12:09:44 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E6775260517; Mon, 5 Oct 2015 12:09:42 +0200 (CEST) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by alsa0.perex.cz (Postfix) with ESMTP id 4548B260504 for ; Mon, 5 Oct 2015 12:09:07 +0200 (CEST) Received: by pacfv12 with SMTP id fv12so176478974pac.2 for ; Mon, 05 Oct 2015 03:09:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=kMnRVkHflRfeOiV65g9+8DUX2we1Gxx+OypjuiMfl9I=; b=ec+Vm/WY/6dUz/kxNlGN/gRsEN/R5KYLbMpBgjXPY5S/7ENzOEOJlpb0Dy8KvwkzE0 QVRZ7R0Rabs/37kflnzf66lb6bXpm6n5UU2ypuzjTEXdTGlVuJkwr2owCF6oFC5axbyO 5QFWClNzeWzJzSgwb6oJ3OY9mqVGycc0WJGRI3q4rDZPutZFxrKsMPQFhVhaojQVeNHN OiCmtoawbwwrDXKdjpvp2GKbLvIbjGjYbkHnRzxiqAnVDtA5/DyOTzM7tvL/Lg72RSuR s7hbQ48zQOyTBBWZUsK8DU2Jp7a19kISxpAqW5kR6MTwKwNqShNRyrrz1/WJIM4hnImC JhWw== X-Gm-Message-State: ALoCoQn2+LqZ+prac4ODwewFf9QNYzpOAAMAJNrRt/awsnCCxJqmmXp2ubl1iL8J1SqPgNdWpBfM X-Received: by 10.66.216.1 with SMTP id om1mr38985225pac.51.1444039745916; Mon, 05 Oct 2015 03:09:05 -0700 (PDT) Received: from phoenix ([1.161.43.54]) by smtp.gmail.com with ESMTPSA id bz1sm26871677pad.36.2015.10.05.03.09.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 03:09:04 -0700 (PDT) Message-ID: <1444039739.8819.2.camel@ingics.com> From: Axel Lin To: Bard Liao , Oder Chiou Date: Mon, 05 Oct 2015 18:08:59 +0800 X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Cc: alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood Subject: [alsa-devel] Regarding ASoC: rt286: Fix the runtime error in the booting X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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);