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: 82811 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp816970vqo; Wed, 12 Apr 2023 23:10:11 -0700 (PDT) X-Google-Smtp-Source: AKy350bPVvIqR2Vtl5nfUxHbvzrdGu9VP/QxyrTjEeXK77Aw4Igoq9hLwymrzO4qBcOgZwC6pRA7 X-Received: by 2002:a05:6402:514a:b0:505:d16:9374 with SMTP id n10-20020a056402514a00b005050d169374mr724710edd.9.1681366211029; Wed, 12 Apr 2023 23:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681366211; cv=none; d=google.com; s=arc-20160816; b=KnVwL5ndCzVft14CBFBvwCags4za8QwppEuGijfHRAEfa9MVuzQdH0IZsqH78sm83p Hn2aP+JaHXH+s6au1+RJQ3LSQ8bixqh4Jtdpt9403bswGAq9aftllLOmZLaVAB93w1Fv vqWqfvfxYKvE4jdabBv91W8sfoKyTcKPQRKGGJ8H7fT0h+y/iECVWIrOcgjUmpjdqN3I 8NNXPoDRHzOw3Y0/ygtlPtvIUvBNBNfhNmeKVcPyJjn97E0/YjqQhTmYRM4/S0fDnRHN J4juPWLxKD/zNfP36vwIBzbLGn3Rx8pBbRJuCkYVS2m9KrWP8eK9zNdm75Sb3kIGawPc dOPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HJ4uYohqhO5JqFEjEQUtiBcTsfOr+xM3+1DXKHvV6cY=; b=DvPLOsAQaYISlJzXQTa9SNtzT1gnvIBmKPixavtJpBeCBXVeIUBP8+9rHasvcH6rN2 rEdvQD1pbLqRaJUwMbIgiOz5nk0ALavHckuJficVlrsrY/zP9Oo3+cHJK77cAbU0Dobn 0Y8xDjxVT+qJx8FiZPyfhQv4Dd4U1+lDbcn95EQJLbNs7FVU7IU5pi7aH6WaBvD/espC sctQ9I+A5gK2ZGBcOy8fBnQ6NNAAfCSOebdNFi++asz/+VbWImJroTg3i/2nyhFBtoTS ZVI5HELvZMMMyaHCaM0zOFWA7mducaAN3zieMtJfdGEDa1slYjH6HPxioudU2pTmcNYM cDpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@orange.fr header.s=t20230301 header.b="nZEHyBk/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d19-20020aa7ce13000000b00504b5c594d2si1105068edv.419.2023.04.12.23.09.47; Wed, 12 Apr 2023 23:10:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@orange.fr header.s=t20230301 header.b="nZEHyBk/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229503AbjDMF2n (ORCPT + 99 others); Thu, 13 Apr 2023 01:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjDMF2l (ORCPT ); Thu, 13 Apr 2023 01:28:41 -0400 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D69F4EDC for ; Wed, 12 Apr 2023 22:28:39 -0700 (PDT) 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 Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , alsa-devel@alsa-project.org 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763040255825354486?= X-GMAIL-MSGID: =?utf-8?q?1763040255825354486?= 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 */