From patchwork Sat May 20 14:50:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 96798 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp411680vqo; Sat, 20 May 2023 08:04:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ucj6x8so9NlAZnmB6RGGif+uKiJAV34722bMcqsAALjQH6tgE7HtSFFzKhP4xjLrk4D/y X-Received: by 2002:a17:902:e547:b0:1ad:df75:45e0 with SMTP id n7-20020a170902e54700b001addf7545e0mr6977347plf.39.1684595051802; Sat, 20 May 2023 08:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684595051; cv=none; d=google.com; s=arc-20160816; b=QCN0RMtdTMeA/1BQYpJFhaQ+rfWV/9cJQiVzICS9zA6fxodX02QH9WSeux0/E/1W2u WJGPA34ROUzVEJP3QS8r9u6UfWsFBP+ZviWelKgh1jQ9lIWmV3zC70z5mJ8HfFKotvCS djYi4siYC8Nhgpf4KUFGVQ9gkbb7REbVYXU3GgXuJy6sBrAN6xvIBhe62HOdi3J7Mc3w CyQWI7Iqe82xsnoPdE1okraHEGuJJ/R5n9yQdYRF0z5FXy6et6nkK71/RY2Vl6yDlglF vogL4eYdw0ZrbY7+ICtIlzJ2jbi+MTE0M482fFei6pSqb4hHOr3qBVrpec2efdemA4lF V+Og== 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=Gs5jc+zEfJwVCuLHjEL/NLyniIuEyQrXlCdxCYb+hJA=; b=zXUVMeIsVEXlHzSyENU7gAsNHC4fpHapp8mjAJvezQsaPB9OGbLctpK7dtJWgfKFUF WL/ln/Ni/BWeakdo164NLzt0hjDlZhErcb7B4FAkh58Zc/5EIIvXibkNjDDXsMi1mpku mPC3y8QkVFCte+dermw4+LJH80MfzBD8AjvA6dX93p9aztRto3bi1CKsihyF6M8YentI e+s+L3cTJn8z2jTOgkfLhQGLRSDj5MIRXF5YFUGBbJqwFxNYRytBghqyGboViwjXYHO6 yqiPpvVSgKYKBdTpdUPZFjoX/FLGyW5viNqJlmIW9B1lVIAUVSMz5xXZI8GdWLATfYln yDqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=e9DSYsns; 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 l12-20020a170903244c00b001ab10e58308si1596515pls.400.2023.05.20.08.03.57; Sat, 20 May 2023 08:04: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=@wanadoo.fr header.s=t20230301 header.b=e9DSYsns; 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 S229662AbjETOvC (ORCPT + 99 others); Sat, 20 May 2023 10:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjETOvA (ORCPT ); Sat, 20 May 2023 10:51:00 -0400 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6771B9C for ; Sat, 20 May 2023 07:50:59 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 0Nv5qCAc8f2fi0Nv5qlWU3; Sat, 20 May 2023 16:50:57 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684594257; bh=Gs5jc+zEfJwVCuLHjEL/NLyniIuEyQrXlCdxCYb+hJA=; h=From:To:Cc:Subject:Date; b=e9DSYsnsS1ydxT+Dx6SGfc4dIS0EMtm5SjEC8HRqituPaP4K4jRRiAQMh8oO6N0rh 1ea+gA1KhSIdWhmRCutIDkacVEJQkOBdN5GjkvZRP06EvdKjFudkN1K8rWu1v0r51M qeU86Dl2YIH5zmS042fE1gUVf752xCOc9TJD0ZuryOnjV0ZkOYJAz/3cdkg5MKc7wN C+u2ZWJnEv2wsQZgeam+kzkJbg6F55k/4Et0vTX+wC/areeSoKkiYLjL2vDAyZ4EHE N7nfFvnhjx6W095nnQPnbEl8A1j/GGQtOVX37tuhrITZq4ePm32WwdesNUStlTJFJD YUqKMEfu0yBbw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 May 2023 16:50:57 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: James Schulman , David Rhodes , Richard Fitzgerald , 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, patches@opensource.cirrus.com Subject: [PATCH] ASoC: cs42l51: Use the devm_clk_get_optional() helper Date: Sat, 20 May 2023 16:50:54 +0200 Message-Id: <3debf3bb7ea504ee9ca2d8eb0f948a426681cbdd.1684594240.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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?1766425940758561115?= X-GMAIL-MSGID: =?utf-8?q?1766425940758561115?= Use devm_clk_get_optional() instead of hand writing it. This saves some LoC and improves the semantic. Signed-off-by: Christophe JAILLET --- sound/soc/codecs/cs42l51.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index e88d9ff95cdf..a67cd3ee84e0 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c @@ -724,12 +724,9 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap) dev_set_drvdata(dev, cs42l51); cs42l51->regmap = regmap; - cs42l51->mclk_handle = devm_clk_get(dev, "MCLK"); - if (IS_ERR(cs42l51->mclk_handle)) { - if (PTR_ERR(cs42l51->mclk_handle) != -ENOENT) - return PTR_ERR(cs42l51->mclk_handle); - cs42l51->mclk_handle = NULL; - } + cs42l51->mclk_handle = devm_clk_get_optional(dev, "MCLK"); + if (IS_ERR(cs42l51->mclk_handle)) + return PTR_ERR(cs42l51->mclk_handle); for (i = 0; i < ARRAY_SIZE(cs42l51->supplies); i++) cs42l51->supplies[i].supply = cs42l51_supply_names[i];