From patchwork Wed Feb 21 15:25:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 774544 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A926EC48BEB for ; Wed, 21 Feb 2024 15:25:04 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 66271B65; Wed, 21 Feb 2024 16:24:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 66271B65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708529102; bh=C4eam5B1/ua7yw+Vatsep/Lrr+vtYohYNHxWd27npZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OFo5bdumiLwlItAFCekH+6ZYHHyJGAdkD7hnpQxtgE8FmvG3aA6RORAivm7O58XB/ amI7DvZvEXsH0baWGZ2yoV0QTqSEoSqZagfPpDngT+OHwrG3G77jiUgEtVh6C3nqR5 zpY8Z2GkWbKNs1Ud51QPTBM8fwOTEhWYzhoFKYa8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 234AAF805EA; Wed, 21 Feb 2024 16:24:02 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DEFEEF805F2; Wed, 21 Feb 2024 16:24:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5CA22F8057A; Wed, 21 Feb 2024 16:23:56 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B4151F8047D for ; Wed, 21 Feb 2024 16:23:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B4151F8047D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AfhXTYVU DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708529031; x=1740065031; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=C4eam5B1/ua7yw+Vatsep/Lrr+vtYohYNHxWd27npZw=; b=AfhXTYVUQMRwIfdiyjjPBPfuuvocb+ws0A4SsS8/d+eYkOzKAA0NCfeX wVEN4S2csEKdym9fEElXMy6/C6yDP6+j/RYbOMErvkBq7oBCiXa4VOByp oaTJuxHHO0zgK9VE9E7mfDuqUaG1MEc9/AajUOkZUOpvxTmZg5EwsF/LV fBsO7PHE5aZ/xSTVacZgH7fNHsPOKtE5hXGJhZLAN2Sck5pJc0zeBs70L 9F08RwRQs97zcdKkSTPqH+ylaX2XfagE8bJ3dkcxfGtUWYqz7o3sxE9Wl vbcA67oR+0+bvDX0UDkgTNEna8s9Dh1Do6EPbqAtQxze676lsFmydjbVb g==; X-IronPort-AV: E=McAfee;i="6600,9927,10991"; a="14104790" X-IronPort-AV: E=Sophos;i="6.06,175,1705392000"; d="scan'208";a="14104790" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2024 07:23:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,175,1705392000"; d="scan'208";a="5374253" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmviesa006.fm.intel.com with ESMTP; 21 Feb 2024 07:23:46 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH 2/6] ASoC: codecs: nau8825: Simplify mclk initialization Date: Wed, 21 Feb 2024 16:25:12 +0100 Message-Id: <20240221152516.852353-3-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240221152516.852353-1-cezary.rojewski@intel.com> References: <20240221152516.852353-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: 3NELF7P37MG47SYS6HMEV3XQ2FIU6BZC X-Message-ID-Hash: 3NELF7P37MG47SYS6HMEV3XQ2FIU6BZC X-MailFrom: cezary.rojewski@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski --- sound/soc/codecs/nau8825.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index 5cb0de648bd3..cd30ad649bae 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -2836,16 +2836,12 @@ static int nau8825_read_device_properties(struct device *dev, if (nau8825->adc_delay < 125 || nau8825->adc_delay > 500) dev_warn(dev, "Please set the suitable delay time!\n"); - nau8825->mclk = devm_clk_get(dev, "mclk"); - if (PTR_ERR(nau8825->mclk) == -EPROBE_DEFER) { - return -EPROBE_DEFER; - } else if (PTR_ERR(nau8825->mclk) == -ENOENT) { + nau8825->mclk = devm_clk_get_optional(dev, "mclk"); + if (IS_ERR(nau8825->mclk)) + return PTR_ERR(nau8825->mclk); + if (!nau8825->mclk) /* The MCLK is managed externally or not used at all */ - nau8825->mclk = NULL; dev_info(dev, "No 'mclk' clock found, assume MCLK is managed externally"); - } else if (IS_ERR(nau8825->mclk)) { - return -EINVAL; - } return 0; } From patchwork Wed Feb 21 15:25:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 774543 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F5D3C48BF6 for ; Wed, 21 Feb 2024 15:25:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9F4CADF6; Wed, 21 Feb 2024 16:25:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F4CADF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708529127; bh=Qtg3t5Qo59zUGmKkh1SsQQK/Vt6TCkwJIxrRq/xMrnI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cvPPjenOXzMOBYIRiebPzgKZoY4aiEtB32s7d+Qy1uSmEzpTZARfitQLNO8FhmDV6 6nkG1VuIFpYbCvfbQPsaVT2jwuhKqhyYEJvbR8zcAPEvlxbd+1ekjVtVD/hnGCUxWx LRYWhtmhsvw309sfnqzXmw7o79tzouaBP5fPT4bg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 203F3F80568; Wed, 21 Feb 2024 16:24:09 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 821DEF80568; Wed, 21 Feb 2024 16:24:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 61744F805FA; Wed, 21 Feb 2024 16:24:01 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BF584F805BF for ; Wed, 21 Feb 2024 16:23:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BF584F805BF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YnBhamqS DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708529038; x=1740065038; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qtg3t5Qo59zUGmKkh1SsQQK/Vt6TCkwJIxrRq/xMrnI=; b=YnBhamqSG1YnsQnBVZHP3SWF8NWAjwAfWnhm7HnG5MSxz/c8bqcbNymg rqN3SNOyko2R9Rd9ZVSYWiyboORAG5xT00vwA4kKyvFKE/3k7d+UZcS1v F1gHOnJRsOL3MBHnUr//7eV9+uYjkQJNKqM3HzgTiuLy5LPXfFIgXRlkr z6E5pOIME3SK67LQcgxgeGdcMKqQlzpVXLq8KbdHVuKoB7XdCP79squwM pKArYnSAXP56s0WaAr3sLyqIhRtWGDL/RYJ0vhUee6SaTrW8OZU4RBNWZ SapkOgU9gnbMPu1Bta/4KnFuVQa8+fKNK55oo/iS1yvpMDGu5zg9uGOob w==; X-IronPort-AV: E=McAfee;i="6600,9927,10991"; a="14104813" X-IronPort-AV: E=Sophos;i="6.06,175,1705392000"; d="scan'208";a="14104813" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2024 07:23:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,175,1705392000"; d="scan'208";a="5374278" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmviesa006.fm.intel.com with ESMTP; 21 Feb 2024 07:23:51 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH 4/6] ASoC: codecs: rt5616: Simplify mclk initialization Date: Wed, 21 Feb 2024 16:25:14 +0100 Message-Id: <20240221152516.852353-5-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240221152516.852353-1-cezary.rojewski@intel.com> References: <20240221152516.852353-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: ZBMDI7WLTQSBTVTVWB4NKIIZ7FJFO7HI X-Message-ID-Hash: ZBMDI7WLTQSBTVTVWB4NKIIZ7FJFO7HI X-MailFrom: cezary.rojewski@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski --- sound/soc/codecs/rt5616.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/rt5616.c b/sound/soc/codecs/rt5616.c index c13108b51eaf..e7aa60e73961 100644 --- a/sound/soc/codecs/rt5616.c +++ b/sound/soc/codecs/rt5616.c @@ -1174,9 +1174,6 @@ static int rt5616_set_bias_level(struct snd_soc_component *component, * away from ON. Disable the clock in that case, otherwise * enable it. */ - if (IS_ERR(rt5616->mclk)) - break; - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { clk_disable_unprepare(rt5616->mclk); } else { @@ -1225,9 +1222,9 @@ static int rt5616_probe(struct snd_soc_component *component) struct rt5616_priv *rt5616 = snd_soc_component_get_drvdata(component); /* Check if MCLK provided */ - rt5616->mclk = devm_clk_get(component->dev, "mclk"); - if (PTR_ERR(rt5616->mclk) == -EPROBE_DEFER) - return -EPROBE_DEFER; + rt5616->mclk = devm_clk_get_optional(component->dev, "mclk"); + if (IS_ERR(rt5616->mclk)) + return PTR_ERR(rt5616->mclk); rt5616->component = component; From patchwork Wed Feb 21 15:25:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 774542 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76E7FC48BEB for ; Wed, 21 Feb 2024 15:26:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D0992839; Wed, 21 Feb 2024 16:26:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D0992839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708529170; bh=gzcWGNL38cfVL/MuMfhSxMmLpqdQ1ceJameavm9K4g8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=tb5Sf8rYOgnzF2EJWUGc2VlhMHUkSc5RPkEeRo2g41ivL5Xb/reUm4YzjrlERLBki M0+43c42aTPOhK9J3UT8KMRNQZBNFGJRx8boEFeJJnNExlZAre/SnpKeJVxW4tfK+W Z/2xuF5F3NwQMKRPFK2rBfUz03EeYlYyF/mnMSa8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A6EB7F8069A; Wed, 21 Feb 2024 16:24:28 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 5C57CF8069C; Wed, 21 Feb 2024 16:24:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9D087F8057D; Wed, 21 Feb 2024 16:24:24 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3A104F805C5 for ; Wed, 21 Feb 2024 16:23:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3A104F805C5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=A32p+zMR DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708529040; x=1740065040; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gzcWGNL38cfVL/MuMfhSxMmLpqdQ1ceJameavm9K4g8=; b=A32p+zMRl4AML/hFsoHdXFgwyTFnj+JdyB7te1astnfovk3a8OkllBmi cIY4JZf7SKOD4NLuWiLNNiDIalO2Tm04lNfQxDUAZG67CASt93r86mG6X 1NJPXgAgCOzJclntOAocOlSIDfsCYKVQYTB5mlcdnBKLbKWAzW32zdHVo wUXDEHeZZYo2nv0mI+rQGqy76bO7wiQ//a7PGOmiyanD8PF8bzYQqrXDs 5iShfr7kg88bi706E+zaPSkvM17jaP7ZndPNYmqt3Bq6/mt9sB29LPaZH p0jRjZKx7PSX4HM8q8lpxgxQzAdxVVfdHzK7jKImGaLVG6Y3ZrFUYmaJ+ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10991"; a="14104833" X-IronPort-AV: E=Sophos;i="6.06,175,1705392000"; d="scan'208";a="14104833" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2024 07:23:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,175,1705392000"; d="scan'208";a="5374293" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmviesa006.fm.intel.com with ESMTP; 21 Feb 2024 07:23:55 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH 6/6] ASoC: codecs: rt5660: Simplify mclk initialization Date: Wed, 21 Feb 2024 16:25:16 +0100 Message-Id: <20240221152516.852353-7-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240221152516.852353-1-cezary.rojewski@intel.com> References: <20240221152516.852353-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: DQLXL4TSKJ7XAJRP5FMLGM7TAA5IH2YQ X-Message-ID-Hash: DQLXL4TSKJ7XAJRP5FMLGM7TAA5IH2YQ X-MailFrom: cezary.rojewski@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski --- sound/soc/codecs/rt5660.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c index 0cecfd602415..d5c2f0f2df98 100644 --- a/sound/soc/codecs/rt5660.c +++ b/sound/soc/codecs/rt5660.c @@ -1079,9 +1079,6 @@ static int rt5660_set_bias_level(struct snd_soc_component *component, snd_soc_component_update_bits(component, RT5660_GEN_CTRL1, RT5660_DIG_GATE_CTRL, RT5660_DIG_GATE_CTRL); - if (IS_ERR(rt5660->mclk)) - break; - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { clk_disable_unprepare(rt5660->mclk); } else { @@ -1277,9 +1274,9 @@ static int rt5660_i2c_probe(struct i2c_client *i2c) return -ENOMEM; /* Check if MCLK provided */ - rt5660->mclk = devm_clk_get(&i2c->dev, "mclk"); - if (PTR_ERR(rt5660->mclk) == -EPROBE_DEFER) - return -EPROBE_DEFER; + rt5660->mclk = devm_clk_get_optional(&i2c->dev, "mclk"); + if (IS_ERR(rt5660->mclk)) + return PTR_ERR(rt5660->mclk); i2c_set_clientdata(i2c, rt5660);