Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1188038ybg; Fri, 18 Oct 2019 13:28:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqw41l9ffb2bK5tJQP28bSTxWi1vF+pyNUb0ka0xH+TDrl7j/b6uGWeLRXxcmv93U6YooMmH X-Received: by 2002:a17:906:3053:: with SMTP id d19mr10854346ejd.109.1571430509144; Fri, 18 Oct 2019 13:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571430509; cv=none; d=google.com; s=arc-20160816; b=pZ9Bfn+vdVXBSJP8sp5HnCwStNhgKe36cyJ6HivEoborknR4SP1sUoyn9j9q7/2JIF y9f+kZI0tc4/8ct/0TDJvYUkK0ewcvjvszZWEEAI9F0mLRbclthWXVWsODnF/ZgJ4zeJ Xx79tnVGLvkn+GZeSp+Vc6P+KsanlNykfD1UKl9MnZZSbX2j/LXf0pr0QF3mTzrIWdEu RYeZpuvasL1lASxdJ3js53tw1xw9y8QfmEX3UNLLT8E3DNLsXwNd2zODV/wGMafglrr3 0lIQYPNpCZEQABHoEDn4IFxqBBX3Df2nGoXsntYi3W6AyfVTy/ykBaWWZzwHEoyAP0yX ZPPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=TdIhIfBcFLQ1lcUcT5Cu1vd+eyiPNqhDsIP+zGHYYGs=; b=xLE/stnhUwHK7yQRPOZOW2WWGCdTyg7N+n14WqF2EmOpQXvm0WRadqv5h1RRSQzq7V ShsYzeYcvNWK9MhkhA6uhnyM+PnDWSrvyR8iFMm/1jeRYuVvyR2k5jPuCNL4OAnqA2gD pHKMzMrpaPcoPIAInHmKeSiLQ2ELtjJa7a5JwbNK3sculaHp4hDIpqXSyn/YPKpJct3i 2+GWnDXhrLayMe3A9wc/inTM3yXtRGYRqgxXRfx5rXDwxx45k5x12fDyO5B0mLnaZZtI W6PcfrnIBgiTsJCuFsZYlE5JqJ/F3UB+KvInjc+WxjMqh9axPkdiSufG3NjM0V5o+ENE egag== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si4731847edh.358.2019.10.18.13.27.35; Fri, 18 Oct 2019 13:28:29 -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; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406160AbfJQOt2 (ORCPT + 99 others); Thu, 17 Oct 2019 10:49:28 -0400 Received: from mga11.intel.com ([192.55.52.93]:25834 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbfJQOt2 (ORCPT ); Thu, 17 Oct 2019 10:49:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2019 07:49:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,308,1566889200"; d="scan'208";a="190045703" Received: from albeaudr-mobl1.amr.corp.intel.com (HELO [10.252.136.206]) ([10.252.136.206]) by orsmga008.jf.intel.com with ESMTP; 17 Oct 2019 07:49:24 -0700 Subject: Re: [alsa-devel] [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get To: Chuhong Yuan Cc: Cezary Rojewski , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20191017025044.31474-1-hslester96@gmail.com> From: Pierre-Louis Bossart Message-ID: <31fb322b-c0c2-b783-47bc-52be842f8661@linux.intel.com> Date: Thu, 17 Oct 2019 08:16:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191017025044.31474-1-hslester96@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/19 9:50 PM, Chuhong Yuan wrote: > sof_audio_probe misses a check for devm_clk_get and may cause problems. > Add a check for it to fix the bug. Indeed this is a miss, we have this test in all machine drivers except this one. Thanks for the patch! Acked-by: Pierre-Louis Bossart > > 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, >