From patchwork Mon Jan 19 07:23:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Lauss X-Patchwork-Id: 5655131 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 212689F333 for ; Mon, 19 Jan 2015 07:24:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BE6420353 for ; Mon, 19 Jan 2015 07:24:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7E6382034C for ; Mon, 19 Jan 2015 07:24:08 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F2B07260547; Mon, 19 Jan 2015 08:24:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 46EF2260527; Mon, 19 Jan 2015 08:23:58 +0100 (CET) X-Original-To: alsa-devel-archive@alsa-project.org Delivered-To: alsa-devel-archive@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 66CBE260529; Mon, 19 Jan 2015 08:23:57 +0100 (CET) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by alsa0.perex.cz (Postfix) with ESMTP id F2645260525 for ; Mon, 19 Jan 2015 08:23:49 +0100 (CET) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751090AbbASHXr (ORCPT ); Mon, 19 Jan 2015 02:23:47 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:42876 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbbASHXr (ORCPT ); Mon, 19 Jan 2015 02:23:47 -0500 Received: by mail-we0-f175.google.com with SMTP id k11so29761627wes.6 for ; Sun, 18 Jan 2015 23:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9atjOjj2P4s7KadlhBDuXQ+Rc52YIB1d8cXW6A0tz4I=; b=d2EWYG26IiEZ+PjoSwTpPBOCfny3WBfMpqiaYPF+0jKlkFiFpY2g9/tJczLuIflWaF K4nJ+JYKpuF1FcgSuOTUkDAfSOXxmMHTiKIq72OGYhEGIwnnS9Qmt/Mf/Q3xEtwJosxq TOBupIKiaBmH0oXPDU93q03+OZfUp28xB42f2w3W8+ZO+eAuLGpmiY5dQmWZkQWfj3a5 rJedoIQPdMeuLfjHW8+pnvt0GTzZraFSGjsHNV2Khh26ln5tbmOuXzqy6E0aQqqZyD/7 kXuxHZDlGcrpb5Gk41xgejhDfpiun7fAsMeycj3BGUOnyyMcE2z+ZFHIWTs3G1QnPiPm eF0Q== X-Received: by 10.180.98.202 with SMTP id ek10mr8371785wib.56.1421652225645; Sun, 18 Jan 2015 23:23:45 -0800 (PST) Received: from dargo.Speedport_W_724V_01011602_00_001 (p4FCD3E1D.dip0.t-ipconnect.de. [79.205.62.29]) by mx.google.com with ESMTPSA id k1sm1831707wjn.9.2015.01.18.23.23.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Jan 2015 23:23:45 -0800 (PST) From: Manuel Lauss Date: Mon, 19 Jan 2015 08:23:43 +0100 Message-Id: <1421652223-721475-1-git-send-email-manuel.lauss@gmail.com> X-Mailer: git-send-email 2.2.1 Precedence: bulk X-Mailing-List: linux-alsa@vger.kernel.org To: alsa-devel@alsa-project.org Cc: Manuel Lauss Subject: [alsa-devel] [PATCH] ASoC: wm8731: init mutex in i2c init path X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The I2C init path forgot to init the mutex, leading to an oops when controls are accessed. Signed-off-by: Manuel Lauss --- Fixes an oops on bootup when alsactl tries to restore codec parameters on my MIPS DB1300 board. sound/soc/codecs/wm8731.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index b9211b4..b115ed8 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -717,6 +717,8 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, if (wm8731 == NULL) return -ENOMEM; + mutex_init(&wm8731->lock); + wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); if (IS_ERR(wm8731->regmap)) { ret = PTR_ERR(wm8731->regmap);