From patchwork Thu Apr 13 05:28:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 672849 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 59E6CC77B61 for ; Thu, 13 Apr 2023 05:30:08 +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 5C5EAF31; Thu, 13 Apr 2023 07:29:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5C5EAF31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681363804; bh=MlpfhSGmhaTBOXmsMz9tvKmv3bCJYV5veDR+Rl1z59g=; h=From:To:Subject:Date:CC:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=IcYB3g8svGvG7KrkzpmUCBgthtDGxCXAiGg0lZLDKtNpOThThpSvAL1eQtC+wYjaF kWJv/fc/QH93vTsWOZfqmIm6ZcS07iTn3rb5XSkdBrH7zXLSTaKuQxV3iUa9crn378 94ywK9PuNsP1l3/qNeq+9XWYvWl2lOqZjIi9bTe4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B7542F800E5; Thu, 13 Apr 2023 07:28:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 73A01F8032B; Thu, 13 Apr 2023 07:28:45 +0200 (CEST) Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AED2AF800E5 for ; Thu, 13 Apr 2023 07:28:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AED2AF800E5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=orange.fr header.i=@orange.fr header.a=rsa-sha256 header.s=t20230301 header.b=nZEHyBk/ Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id mpVbpJJcvfW5impVbpzK6l; Thu, 13 Apr 2023 07:28:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1681363717; bh=HJ4uYohqhO5JqFEjEQUtiBcTsfOr+xM3+1DXKHvV6cY=; h=From:To:Cc:Subject:Date; b=nZEHyBk/1Xb/k7IkI84pd/6i44tpo4Ff3pgJ7RyPDu0zQ9KVAw6KdKGwes24HQdPI w6YlUxHyK6JkpqatV0INzjTy6N+YkMSMRMrqtWJHM2mCK1VYOrHq9z0p7I6ajndQHf /d1dOGA+w58EvmCp7euupSd7OKat3OelxhBa4+J9dqdpKdzsnHk51Q2nEmur/KaBZK qeC+nP7l60AUlsbqGWWenboze1Bqbtdt8fHbZrz1UisCFQQYn+GTjSRql1TDN1fFG1 yWzXV6rBvtH+3CC8vta28nh9NoTwAMsQikBn8PaWEM9JAMDEThvxX2oHQULikFKlLp V69Ur+VhEifvA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 13 Apr 2023 07:28:37 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Support Opensource , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH] ASoC: da7218: Use devm_clk_get_optional() Date: Thu, 13 Apr 2023 07:28:33 +0200 Message-Id: <51976b2515d7007ba5c8aa7524892f147d7cdd51.1681363691.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: GJ7NXRMPBUK2QJ7PKSIBTC7MAZC7DDAE X-Message-ID-Hash: GJ7NXRMPBUK2QJ7PKSIBTC7MAZC7DDAE X-MailFrom: christophe.jaillet@wanadoo.fr 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 CC: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , alsa-devel@alsa-project.org X-Mailman-Version: 3.3.8 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: Use devm_clk_get_optional() instead of hand writing it. Signed-off-by: Christophe JAILLET --- sound/soc/codecs/da7218.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c index 91372909d184..d9c28e701613 100644 --- a/sound/soc/codecs/da7218.c +++ b/sound/soc/codecs/da7218.c @@ -2893,14 +2893,10 @@ static int da7218_probe(struct snd_soc_component *component) da7218_handle_pdata(component); /* Check if MCLK provided, if not the clock is NULL */ - da7218->mclk = devm_clk_get(component->dev, "mclk"); + da7218->mclk = devm_clk_get_optional(component->dev, "mclk"); if (IS_ERR(da7218->mclk)) { - if (PTR_ERR(da7218->mclk) != -ENOENT) { - ret = PTR_ERR(da7218->mclk); - goto err_disable_reg; - } else { - da7218->mclk = NULL; - } + ret = PTR_ERR(da7218->mclk); + goto err_disable_reg; } /* Default PC to free-running */