Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp278786ybg; Thu, 17 Oct 2019 22:58:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3A2kmZazBLkhaGYH36o/MKJ1fIa7gyKc/Snz31ovimtrJlmPU52dok7HtuFZkCQgJvB9B X-Received: by 2002:a17:906:48cf:: with SMTP id d15mr7213764ejt.59.1571378319166; Thu, 17 Oct 2019 22:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571378319; cv=none; d=google.com; s=arc-20160816; b=04/Zp4Xw7ftaQpfgNC2LfSeYy1vbckPAsoMlIYHHvnpMH/slavCGGGVAWsY7hAbf11 3nB3XqWtWUR+OQJ2zOzVstTEUuVrgZ34wmDCUukipZCwuaq1hUIg6UV95zUOwldA5AW5 0+x+3RSMiY4lNqL+Qe2RifFoJdS/FwBXeXI9e3wClwpwA0RNHJGmGg5YPVeW/RopVsy7 N17b3FzGbFYLjqQbwFaSsnm/m6iel3XdFTWJzF790S4MNdQCy7FvoYwEDi2RFbDMNOoE 0AYo0eZirHpajsYw2uT3k5VMBqsiwchJWXpUq3XCO13ct4XkhiTTNIzZSItpM3ANJXe3 z4nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=ZBH7etPDsYjgS5BhMdpaKPc/Crn0//m1aMzm71ODCNQ=; b=cmBnpZNiBHYW5Fx76Q/rhGY5UAIaAjaXuFE0KH05amuBb7chdsjtpct+P7f+aAQ8Rb UT4R953X0ynVYOVu5jkTuY5RRg4a3qGYT3/S/DLSaKr93Lyg0ZieYCY3PfiK6QqYTj0T mURN8cZukpEQ4cv0oTTFcimCYV9qJt17GMY1NMbbJvP3/kv+DAg3/EkAAdF7RTB9g4vy qoFqexNBs7LjbV75kHnhaJmyu5+F2fy1H8ZzdXJYgJG/oM6AkFQJ61Znqu5+0dywPbH+ /YkquK8EWhpgUvb6zbxt5LHviWSJCsiMHpCCma99K5V8KNiyxtmLK0TUQEF03XRYtkVF u6aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WWe3W8J0; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si2779266ejx.135.2019.10.17.22.58.16; Thu, 17 Oct 2019 22:58:39 -0700 (PDT) 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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WWe3W8J0; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404202AbfJQCu7 (ORCPT + 99 others); Wed, 16 Oct 2019 22:50:59 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:34982 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387605AbfJQCu7 (ORCPT ); Wed, 16 Oct 2019 22:50:59 -0400 Received: by mail-pl1-f195.google.com with SMTP id c3so391096plo.2 for ; Wed, 16 Oct 2019 19:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZBH7etPDsYjgS5BhMdpaKPc/Crn0//m1aMzm71ODCNQ=; b=WWe3W8J0p2jYm3Jgp8uyqXVx2DXPc5xEMRUw5652KX5FUo9zGfgs/FhgucBzo3mxth EL8GDPepsOkB/9w5yAg6FkZ3r3NnQNhMOFAMDu6HMehgah4+nhktKEw5nJiqhzLR4BzV I2mCIKX3mYS2SySi65+P6T9dYe2NombsqUncLakU2mU+mqYN7hDBwWCkiLgrnvadeGM1 mMPKElo8K4+u6uxzM3cCnL9mNuTR3tQzZ9A//viv/TRZXnexdjG3CiA58RhpLnxJFK7d 6baBx9RdOcV269dv9B+x5nqdY2/aUMJU/yTOUNfjtIDbtQ98FWAKJZb4MiFXoZFbKxdx BTEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZBH7etPDsYjgS5BhMdpaKPc/Crn0//m1aMzm71ODCNQ=; b=skXzTyekPY8c2uY0gimXAu8UYj3KQn99gMBdZxfWUL5rsdUm7PKGAO/zk29dpF5A1h smZFuxAKZpGfeFvdI+lWYz5AXPZLljb4q1tvgZ2HG5jCliWnFIaeCjyH5p7BnFrTLih3 HI3PnYD649ZBMLoC8+A/5/4kvnMFS8VZJeBro1NwCzPRjGj1fjrigdXUiQKKCL3qJt6a wqAp31z+e6XcZo4NLAgLOs42a10KyxpOuNL2a/FwuGo4+F/tlHH0IQsn2eJlvVAgmR1Q ExCLP3BMxGEbguQBTRG0VJRYPruT4bC35vrHFJfmTRPqn2woaI3U5nZGC1oh07UTqMIK 8kOQ== X-Gm-Message-State: APjAAAW05kfuiqy+qdpAu8mn2dNWK1R5+ReocX/yLHwyYIkZUxP0kiVD F+AqriToSjABL0mNGK1NZsA= X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr341484plo.190.1571280657315; Wed, 16 Oct 2019 19:50:57 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id m4sm530714pjs.8.2019.10.16.19.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 19:50:56 -0700 (PDT) From: Chuhong Yuan Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get Date: Thu, 17 Oct 2019 10:50:44 +0800 Message-Id: <20191017025044.31474-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sof_audio_probe misses a check for devm_clk_get and may cause problems. Add a check for it to fix the bug. Signed-off-by: Chuhong Yuan --- sound/soc/intel/boards/sof_rt5682.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index a437567b8cee..6d15c7ff66bf 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -576,6 +576,15 @@ static int sof_audio_probe(struct platform_device *pdev) /* need to get main clock from pmc */ if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) { ctx->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3"); + if (IS_ERR(ctx->mclk)) { + ret = PTR_ERR(ctx->mclk); + + dev_err(&pdev->dev, + "Failed to get MCLK from pmc_plt_clk_3: %d\n", + ret); + return ret; + } + ret = clk_prepare_enable(ctx->mclk); if (ret < 0) { dev_err(&pdev->dev, -- 2.20.1