Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3608137ioa; Tue, 26 Apr 2022 06:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU83+IUb21+w2+Tc8l2kCV7TaUZIBXgaY9D7o+lQkCkF9hATXIHVQIXYUoBVlv/ymmgtOs X-Received: by 2002:a17:90b:33c8:b0:1d9:9023:1103 with SMTP id lk8-20020a17090b33c800b001d990231103mr8180208pjb.26.1650981004654; Tue, 26 Apr 2022 06:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650981004; cv=none; d=google.com; s=arc-20160816; b=HDMmN7FIoJPyMSiffLFZCWqS9PfA+FQnQkfExqCY5kV9grOFyDEOAFmEy3vwQVvgSS cfA076rL4FMatheN4084xRe5QGr65kppyriUBjUPv/Wpwjh0ugQc4KZRa82VzFs/qPgG E5aezEgVGC7m5M2VBbidRiqTnRHXGewpZMDQrifC6avLYr3GMIER2vFKWG6xdlcn1AFT Y4uYVCy9KcjnC4sObBDYIbUOWa79BAFbz9zA5beUzaqcOMr3OBcbSgBDQ+ThUjk/DBpV KdYHKOta9SQqYQ+1cL4Vgcs4/E0+CHK02z/tmyb7n3Ab8ZKsM0CbrfLdgWKAkV/69T2W 20ZA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Bb//pW1ftUy+bKtSARmFAGI2vuwlzXqjgPTQKqN77sc=; b=O7Mo0q/vwhSB7ddFM5rzO0Av6ahB8iHcl65GVziVyjGmf7bf2XDcIyqGVT2Ot20BxJ Kx4T1pHcJdk+PsGc4HBSLWSNspHxLtHbh2hHJihK2l143nIDRulclP/OmkAHrX16eM3k UwlBxb84jZw6pM/BkArUGqQgIoCM8AWP+ho8KEaYw8dBvUSihKbr+4ahv2JuOnpUO44m FN9r/zfT9RE4saa6zYkXbgxVNrfGAqmvzEnz/FrgS1nyOYKKAodMAO8k8qsurlHQExp+ lP/kqp1XX8B5t1lPBKgP547o2dPOKTu4LWnJuPpu7eN6U1aYz2e2fm5dd79K/fTduNZa HVVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2UrutGPy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a170902b78a00b0015d284e10a2si3504187pls.150.2022.04.26.06.49.47; Tue, 26 Apr 2022 06:50:04 -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=@linuxfoundation.org header.s=korg header.b=2UrutGPy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345044AbiDZJDW (ORCPT + 99 others); Tue, 26 Apr 2022 05:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346916AbiDZIpa (ORCPT ); Tue, 26 Apr 2022 04:45:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DFB913DD8; Tue, 26 Apr 2022 01:36:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A0AA06185C; Tue, 26 Apr 2022 08:36:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DADBC385A0; Tue, 26 Apr 2022 08:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962199; bh=LNen/Hol42nJKmCO91F1P60/W/lNiA3tn9i6VwXxB0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2UrutGPySF6NkR3ee6eZ8xZW0bvaLGv79ODSop2B4fuMSU+eiN6RqNj+dd5+lOkbj A4TIx8erexbJMjzz3AKhdG2DEKfK/9in6qVzccckO6Shxdt+FaXopm17pmWeM1HYJo BMx1h1B4ZEQLV+7DkxV8PB0HujF18giXEyzyv58M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.15 019/124] ASoC: rk817: Use devm_clk_get() in rk817_platform_probe Date: Tue, 26 Apr 2022 10:20:20 +0200 Message-Id: <20220426081747.851459886@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Miaoqian Lin [ Upstream commit 8ba08d3a367a70f707b7c5d53ad92b98b960ee88 ] We need to call clk_put() to undo clk_get() in the error path. Use devm_clk_get() to obtain a reference to the clock, It has the benefit that clk_put() is no longer required. Fixes: 0d6a04da9b25 ("ASoC: Add Rockchip rk817 audio CODEC support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220404090753.17940-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rk817_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rk817_codec.c b/sound/soc/codecs/rk817_codec.c index 8fffe378618d..cce6f4e7992f 100644 --- a/sound/soc/codecs/rk817_codec.c +++ b/sound/soc/codecs/rk817_codec.c @@ -489,7 +489,7 @@ static int rk817_platform_probe(struct platform_device *pdev) rk817_codec_parse_dt_property(&pdev->dev, rk817_codec_data); - rk817_codec_data->mclk = clk_get(pdev->dev.parent, "mclk"); + rk817_codec_data->mclk = devm_clk_get(pdev->dev.parent, "mclk"); if (IS_ERR(rk817_codec_data->mclk)) { dev_dbg(&pdev->dev, "Unable to get mclk\n"); ret = -ENXIO; -- 2.35.1