Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1599237rwl; Sun, 26 Mar 2023 05:53:24 -0700 (PDT) X-Google-Smtp-Source: AKy350Y7GplQ5h5QOvAMc74lIQlBn27buuzpMtvidXY1fdV7WWr4xXpmq2l/Cro3YDodJVqZhY+/ X-Received: by 2002:a17:902:da8a:b0:19e:b2f3:e8c4 with SMTP id j10-20020a170902da8a00b0019eb2f3e8c4mr10308195plx.25.1679835204387; Sun, 26 Mar 2023 05:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679835204; cv=none; d=google.com; s=arc-20160816; b=Xd9YOodv/KxqQkJzCPlC0b9Wi3dtjsWx552FaEKND5G3qRITvFZPY7+QUOBW28un8m kPqPow7AzFocdn1MsXzC/Sb0qfJqR1kMZZziQ6rwGd1bzMyj1XA6RUIk1Lb4oTi1Fvfi QK0qvb1YnLEuWv0GofL3/iN7H1fjxjFxntD6Jdi3rLuYoiUloufBUVKw78DaVDOKy/SA vJwd0uoisK4eFipRirhT1OmQm/zbbFHhJ6afTzMdKtV3EKxwOVXURdGf7/1eTWYSJ4VT Aj9rYYzwP607r7vp6NkzilGsdx0sSGg0FznrVnlF1pAFxRWccf+kYEbcFgdhqyueLgrl ky+w== 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; bh=vestg0NpqwYqPRRiGTwNgBzedimi/cs2Bb/VR9jRyrI=; b=gN+LODaaoWCyyXI2VzHZejV23wxj45RNvGfPH2eIO9C7yonPnEdY58LUUHQhjNKl64 4QsnsBzGMVmUxZdQT7RXdGou2EDOu7kaQOJJ8P7b1T2Pwt8YoV+o59F4JortfevMJ6rS 36Ma9BFuZQMH9oUmc5NGf2qOtzOL6BYpwORBaL2iuKJWfEX6ZqNM93+ePsrZThZMmx/l JHjyZxqostxH4QDAqRC8WbMCNulGoihRtECvp+8I18B1sQAoDTJjArHC88jtsRBj7XRN ruDszWKJbaNV6fKJgavIPbKcOnn695FgEJ7rFroR9fZK/giTkaIEQ2n6yMJZg9J5p6pz S77w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a170902a40b00b0019edb3d138esi17113982plq.327.2023.03.26.05.53.13; Sun, 26 Mar 2023 05:53:24 -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; 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 S231842AbjCZMnq (ORCPT + 99 others); Sun, 26 Mar 2023 08:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbjCZMnp (ORCPT ); Sun, 26 Mar 2023 08:43:45 -0400 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50A0D7D9A for ; Sun, 26 Mar 2023 05:43:44 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gPimpclLpV6zQgPimpzJp6; Sun, 26 Mar 2023 14:43:42 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 26 Mar 2023 14:43:42 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Jerome Brunet , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: [PATCH] ASoC: meson: Use the devm_clk_get_optional() helper Date: Sun, 26 Mar 2023 14:43:38 +0200 Message-Id: <8dab942d6ce47657a9c038295959be80bb2ee09e.1679834598.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 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/meson/axg-tdm-interface.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c index 7624aafe9009..5e5e4c56d505 100644 --- a/sound/soc/meson/axg-tdm-interface.c +++ b/sound/soc/meson/axg-tdm-interface.c @@ -496,7 +496,7 @@ static int axg_tdm_iface_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct snd_soc_dai_driver *dai_drv; struct axg_tdm_iface *iface; - int ret, i; + int i; iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL); if (!iface) @@ -533,14 +533,9 @@ static int axg_tdm_iface_probe(struct platform_device *pdev) * At this point, ignore the error if mclk is missing. We'll * throw an error if the cpu dai is master and mclk is missing */ - iface->mclk = devm_clk_get(dev, "mclk"); - if (IS_ERR(iface->mclk)) { - ret = PTR_ERR(iface->mclk); - if (ret == -ENOENT) - iface->mclk = NULL; - else - return dev_err_probe(dev, ret, "failed to get mclk\n"); - } + iface->mclk = devm_clk_get_optional(dev, "mclk"); + if (IS_ERR(iface->mclk)) + return dev_err_probe(dev, PTR_ERR(iface->mclk), "failed to get mclk\n"); return devm_snd_soc_register_component(dev, &axg_tdm_iface_component_drv, dai_drv, -- 2.34.1