Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1571049pxm; Thu, 24 Feb 2022 05:45:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmNqnawOSkd80s16yjOfAbz+SKbjQcQejVy0uqrVLqkMCVKTx4OOx6jpnIOJ9dJZTua4vd X-Received: by 2002:a63:950a:0:b0:375:64a3:f98c with SMTP id p10-20020a63950a000000b0037564a3f98cmr2449783pgd.22.1645710301401; Thu, 24 Feb 2022 05:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645710301; cv=none; d=google.com; s=arc-20160816; b=EO869VrnZq5aHxBc6rMaBstLKdk5zXVuByWkyLFyHLoFhDsMlCbxWAVY/9/pr01jz1 gz2aNLIL6zLIjpj3NwxnABU6Gg24CDU+0lqI4CoY3EYKgGPLz+AaVhjb23b9NWZoLUEM eEjeWjz0QAL/5gyR6HDdKY+xBWVFmnyr3J9vxqJUZLW7u9umAO58KnQ7FvpBT9NSFMMY sScGZ1JucGHnwZiI8r+8Spsc5QsUyM+ZyFjdwGczZSS1hup3snD5Xh/Y1O2q319ZcYmL 3EwgSdrl/3XrCLbP+cJztvBN7ISsN1+vgASpzLkEnbxAnDSHfABuaPBTeFB2/CFUtiO1 sqwA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4BM5CJMOAHhPAmpP71sdzK8wbdwXXqGTSZfCgqYugXg=; b=aE21z4B+VeIx21zva4xAe6bOKDnhnByvutNlXe7pVl5/e0TJ65EMLznhCTeuDQCrUk Yh0H7Mxv/qbzgqsv0XAHzEbszchq1JJWq6aKqXTPBMjJ0cf9DmanqT/yh4dOZeSLnh3x nc9egnk9oXA4olLseOxC2I1uEcuv27qSDeFvKytpoC/XlGFBr3SLRjHo2rKzNNApbjMj dIp2lCM8wZJ2KHBmaTQpAgtTXDDnQNzaht7EqPTF8wSviRoR+6YgNo2Qm2sGStkBao3Y xfgFOVaBIIlhIUJDfB3/zHkJUUKl0nXboO0CrpPTi8kxOXYr6hSFQB718v1krHG++R5g vXYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n1L4xpTz; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x39si2626489pfh.105.2022.02.24.05.44.44; Thu, 24 Feb 2022 05:45:01 -0800 (PST) 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=@linaro.org header.s=google header.b=n1L4xpTz; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233978AbiBXLSI (ORCPT + 99 others); Thu, 24 Feb 2022 06:18:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233983AbiBXLR4 (ORCPT ); Thu, 24 Feb 2022 06:17:56 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34CF12D210 for ; Thu, 24 Feb 2022 03:17:26 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id j17so2509062wrc.0 for ; Thu, 24 Feb 2022 03:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4BM5CJMOAHhPAmpP71sdzK8wbdwXXqGTSZfCgqYugXg=; b=n1L4xpTzRA0q8gh+4j2RqBvCcWy1klX3V/ib8KM0vfbFhkOWyjB9pXS/5oJpm51rQq INweqZjGSUBpP2Q1odh3RRNLafB1nUBSoMAgIjXGZkk55Pq4UTgXrfWA2YzovmoOCOTi FG/Egy5crEl/WFOcsapHiZrZhmlqhLH14+lhYXF/DNJ7pVCLkhab+1+RjT7Y00RxHG2V cDj7qQxtE1bFZFM1uWCe9IRvQmZNUZtSUh8NyXTd7gJ0q+KsUL/3EScbhc1OJMJ0o9oU jCa4GrX4MpQ00hsslCcfVfbDwbnLHE79BPt3gu0JJpIMe8Le1/oroCffXzQemP+vGQ6c iX5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4BM5CJMOAHhPAmpP71sdzK8wbdwXXqGTSZfCgqYugXg=; b=ZkxPHUMmaDhOhhObIvkDIorfLlDT4GT0AJ9Dl5v5WiGOn5zvv8wmUQB+uFM8REbA82 FGQTJF6YQ+lZToa7GVXvYDkjOYX/cq8vmq2yjXNKU9RBwQh9YG8je1MVfyZFh6GhSX8T 8tIQyHyYGxSxuCrhnGjcGjrEgcA6FqEQleP6hOSt+tyRf3LL3IFLMwOghvMNYVccC0Ad G6YCTatfGjNARGuip+dYKrn9VmkSFpwZsyHxyG4kGA13mzBfy4N7aN8DYDkRyxKzv7e9 7Ri+RSeSQ+fMEW7d+0T2mawlcnQVKJC1JAF4RzaIdSoh7xLbMTAdhsM2Wxk8nkf9zdsg qCsg== X-Gm-Message-State: AOAM532MorR810yRQ8x0yUUhkGl+WJ2CEK34PW9crEeUB6YIgI8/6KL0 VUXXwYqZYdHrqjras4S69Epyew== X-Received: by 2002:a05:6000:178a:b0:1ea:7db1:3159 with SMTP id e10-20020a056000178a00b001ea7db13159mr1819550wrg.9.1645701445430; Thu, 24 Feb 2022 03:17:25 -0800 (PST) Received: from srini-hackbox.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id t4sm2245737wmj.10.2022.02.24.03.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 03:17:24 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, quic_srivasam@quicinc.com, Srinivas Kandagatla Subject: [PATCH v2 03/16] ASoC: codecs: tx-macro: move clk provider to managed variants Date: Thu, 24 Feb 2022 11:17:05 +0000 Message-Id: <20220224111718.6264-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220224111718.6264-1-srinivas.kandagatla@linaro.org> References: <20220224111718.6264-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, SPF_HELO_NONE,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 move clk provider registration to managed api variants, this should help with some code tidyup. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/lpass-tx-macro.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index bd549b387862..75a5513bff16 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -1745,10 +1745,9 @@ static const struct clk_ops swclk_gate_ops = { }; -static struct clk *tx_macro_register_mclk_output(struct tx_macro *tx) +static int tx_macro_register_mclk_output(struct tx_macro *tx) { struct device *dev = tx->dev; - struct device_node *np = dev->of_node; const char *parent_clk_name = NULL; const char *clk_name = "lpass-tx-mclk"; struct clk_hw *hw; @@ -1764,13 +1763,11 @@ static struct clk *tx_macro_register_mclk_output(struct tx_macro *tx) init.num_parents = 1; tx->hw.init = &init; hw = &tx->hw; - ret = clk_hw_register(tx->dev, hw); + ret = devm_clk_hw_register(dev, hw); if (ret) - return ERR_PTR(ret); - - of_clk_add_provider(np, of_clk_src_simple_get, hw->clk); + return ret; - return NULL; + return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw); } static const struct snd_soc_component_driver tx_macro_component_drv = { @@ -1843,7 +1840,9 @@ static int tx_macro_probe(struct platform_device *pdev) if (ret) return ret; - tx_macro_register_mclk_output(tx); + ret = tx_macro_register_mclk_output(tx); + if (ret) + goto err; ret = devm_snd_soc_register_component(dev, &tx_macro_component_drv, tx_macro_dai, @@ -1861,8 +1860,6 @@ static int tx_macro_remove(struct platform_device *pdev) { struct tx_macro *tx = dev_get_drvdata(&pdev->dev); - of_clk_del_provider(pdev->dev.of_node); - clk_bulk_disable_unprepare(TX_NUM_CLKS_MAX, tx->clks); return 0; -- 2.21.0