From patchwork Mon Feb 1 15:54:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jon Medhurst \(Tixy\)" X-Patchwork-Id: 60938 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp99721lbb; Mon, 1 Feb 2016 07:54:46 -0800 (PST) X-Received: by 10.67.2.10 with SMTP id bk10mr38065439pad.26.1454342086542; Mon, 01 Feb 2016 07:54:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ts1si24988648pab.173.2016.02.01.07.54.46; Mon, 01 Feb 2016 07:54:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752926AbcBAPyo (ORCPT + 30 others); Mon, 1 Feb 2016 10:54:44 -0500 Received: from smarthost01d.mail.zen.net.uk ([212.23.1.7]:60642 "EHLO smarthost01d.mail.zen.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752805AbcBAPyn (ORCPT ); Mon, 1 Feb 2016 10:54:43 -0500 Received: from [82.69.122.217] (helo=[192.168.2.110]) by smarthost01d.mail.zen.net.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1aQGoI-000E7s-6j; Mon, 01 Feb 2016 15:54:38 +0000 Message-ID: <1454342077.16701.4.camel@linaro.org> Subject: [PATCH] ASoC: dwc: Ensure i2s_reg_comp{1,2} is always initialised From: "Jon Medhurst (Tixy)" To: Maruthi Bayyavarapu , Alex Deucher , Mark Brown Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Date: Mon, 01 Feb 2016 15:54:37 +0000 X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 X-Originating-smarthost01d-IP: [82.69.122.217] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the case that the driver is configured from device-tree i2s_reg_comp1 and i2s_reg_comp2 aren't initialised, breaking the driver. Fix this by unconditionally setting these values before checking for quirks. Fixes: a242cac1d3aa ("ASoC: dwc: add quirk to override COMP_PARAM_1 register") Signed-off-by: Jon Medhurst --- sound/soc/dwc/designware_i2s.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.1.4 diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index d8afd8e..5f4e6aa 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -636,6 +636,8 @@ static int dw_i2s_probe(struct platform_device *pdev) dev->dev = &pdev->dev; + dev->i2s_reg_comp1 = I2S_COMP_PARAM_1; + dev->i2s_reg_comp2 = I2S_COMP_PARAM_2; if (pdata) { dev->capability = pdata->cap; clk_id = NULL; @@ -643,9 +645,6 @@ static int dw_i2s_probe(struct platform_device *pdev) if (dev->quirks & DW_I2S_QUIRK_COMP_REG_OFFSET) { dev->i2s_reg_comp1 = pdata->i2s_reg_comp1; dev->i2s_reg_comp2 = pdata->i2s_reg_comp2; - } else { - dev->i2s_reg_comp1 = I2S_COMP_PARAM_1; - dev->i2s_reg_comp2 = I2S_COMP_PARAM_2; } ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata); } else {