From patchwork Thu Nov 28 13:34:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 180427 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp157355ile; Thu, 28 Nov 2019 05:35:11 -0800 (PST) X-Google-Smtp-Source: APXvYqy2US8LUHhOG6Y+7NacUCj2SdCXMlgonXAcuIjtn4Wfq0yX1lK2VAO0yKTpHHuyE1/v8uvb X-Received: by 2002:a50:de47:: with SMTP id a7mr38107980edl.77.1574948111179; Thu, 28 Nov 2019 05:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574948111; cv=none; d=google.com; s=arc-20160816; b=qMMSV5gbSet9fBIsB4EfFckmIbFRwWDgRy0WKOVsowysqqzECgzeJAW/M/NqV8hIlN Xo+CvBmxkCIefpo15Ek3r0PQsGbTne+oFoLRwdduFUHG1mibitWv+CbvK8f7uvBUlmtp h3fZnbekEzcNu79P0pqnh/J2kYSXDXJ0XUZx7cwR2Pv6tl/TZWQ5ILJgtJcDB6i/tDBL HkJHQjBIzl4gCPClVwVwTLmzvKrMLu0Wz4kim68sYZvNsv5bUT0F8o67BIYQumIl8Pj3 yZkv8+shwulD9msVxQq1q4hPVAPHZfaFUz9uGARo5vj0pbG4CyE7EWlb+KTnZgwH5iHk OMsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=efZXdx8nOE9IRhU/0a0pMggKVJBaJwNsJBonEmaYwBU=; b=AgPKiqfZXbp7LOyyhoVlOe3bx0DmlEwNdB0yqmZ6C8HG+Eq0p7MAfh5C1gWuVYi2CK naJhq5oancjpM2UKzUT3FiNbwRnhb+O0WDIPrc1B400O9Bhp0Im7B+8PvRmEO0tM90ae 9k0W2wR6Vb3FVPt7ZvHD998H2MGUhw8wbfftvpEMuZGv6axIdkebn/rqVIebOF+ghEXS VCiyNqcxzhNQPmZUKefrxzka2Dblc4l5/U5efjj5o2foF5mBviMSJXPt5roXHD3Og3Vq fSWSfjFdG1+Y853IInxWIBPi4MyoZ5gg0qKagq4bU81alz8NU5anNSseLKZ3GrZqXIwy NseQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EZxEFdIx; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lu2si11617386ejb.83.2019.11.28.05.35.10; Thu, 28 Nov 2019 05:35:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EZxEFdIx; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1726858AbfK1Nen (ORCPT + 10 others); Thu, 28 Nov 2019 08:34:43 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36889 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726733AbfK1Nen (ORCPT ); Thu, 28 Nov 2019 08:34:43 -0500 Received: by mail-wm1-f66.google.com with SMTP id f129so11695282wmf.2 for ; Thu, 28 Nov 2019 05:34:41 -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=efZXdx8nOE9IRhU/0a0pMggKVJBaJwNsJBonEmaYwBU=; b=EZxEFdIxvM62pDLBLLIcES0NSWNTez/Q9a9uibJWaZ3fpi98XzuotDpSxZ2Ni1JC9p Osoa0ZmcJGtW9bz8oF3eTtEsDo3cWTXVM65Pp+UxtNwwW/y52U4MLg2PKQw5nuuUbnCY 91v0xn/r7zmwsm6zVneHY20HFX4ZKRbf/rQF5T+iApX/Lpvy+1QMXKY4NzURC4HoE1RC W+wSvMNPr1zRBZNs0t8/cHMoGyUJ7m/GSgeH5bbtafyMcJv2cbBtFg7xmon8QOYBmfON KUy5wwJQus2MYRSx/tvqiaPK3DvKPq/Vp3LDRY165O62TU/Dr2TbMLo/0b0nY4Luc7Rx frtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=efZXdx8nOE9IRhU/0a0pMggKVJBaJwNsJBonEmaYwBU=; b=G63FIO94yf3qjtGjtfOKYfpb6JOrSO2LPFDM5CFLNxamsvYCRmhxyEKI46m0nZIuP3 pdbPrBA6UagSAtuuxf4WJRtmAuVkIPIyY5wIOqj2aoJKoskTiVGk+QssOFn4EMUcK10v pbTVbo7cnGabALqMkan/HjBQbFIhcvQX/S3zeIm9k+zWhhJLBVfoaVa2oz1vFDZtdrEl 0c1OcT61GyP/s9Tctiw2VkOCu3Q4n3nNhQyLkH6CBudSWcAwKpjZ4miTCnZ4vzY7pkVA 8nuctpz6xUVcPBekSU6S+SFDM4CBkZ2S3cjeA0ujiD+CYM4SzbJkUmGcS0J75wPOuNJv WPDQ== X-Gm-Message-State: APjAAAU+UDKZM/5eAnF2SSbf6UFlxWJIaK4VVnLj0+UyKDP651jWnY9a 5hr/HrN7xTayx2O10sgmlayDJliJLpg= X-Received: by 2002:a7b:cd82:: with SMTP id y2mr8272892wmj.58.1574948080885; Thu, 28 Nov 2019 05:34:40 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y20sm2220451wmi.25.2019.11.28.05.34.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Nov 2019 05:34:40 -0800 (PST) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: bjorn.andersson@linaro.org, agross@kernel.org, digetx@gmail.com, evgreen@chromium.org, daidavid1@codeaurora.org, masneyb@onstation.org, sibis@codeaurora.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH 4/5] interconnect: Add a common helper for removing all nodes Date: Thu, 28 Nov 2019 15:34:34 +0200 Message-Id: <20191128133435.25667-4-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191128133435.25667-1-georgi.djakov@linaro.org> References: <20191128133435.25667-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The removal of all nodes from a provider seem to be a common functionality for all existing users and it would make sense to factor out this into a a common helper function. Suggested-by: Dmitry Osipenko Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 22 ++++++++++++++++++++++ include/linux/interconnect-provider.h | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 467c539310f3..0e4852feb395 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -735,6 +735,28 @@ void icc_node_del(struct icc_node *node) } EXPORT_SYMBOL_GPL(icc_node_del); +/** + * icc_nodes_remove() - remove all previously added nodes from provider + * @provider: the interconnect provider we are removing nodes from + * + * Return: 0 on success, or an error code otherwise + */ +int icc_nodes_remove(struct icc_provider *provider) +{ + struct icc_node *n, *tmp; + + if (WARN_ON(IS_ERR_OR_NULL(provider))) + return -EINVAL; + + list_for_each_entry_safe_reverse(n, tmp, &provider->nodes, node_list) { + icc_node_del(n); + icc_node_destroy(n->id); + } + + return 0; +} +EXPORT_SYMBOL_GPL(icc_nodes_remove); + /** * icc_provider_add() - add a new interconnect provider * @provider: the interconnect provider that will be added into topology diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h index b16f9effa555..31440c921216 100644 --- a/include/linux/interconnect-provider.h +++ b/include/linux/interconnect-provider.h @@ -98,6 +98,7 @@ int icc_link_create(struct icc_node *node, const int dst_id); int icc_link_destroy(struct icc_node *src, struct icc_node *dst); void icc_node_add(struct icc_node *node, struct icc_provider *provider); void icc_node_del(struct icc_node *node); +int icc_nodes_remove(struct icc_provider *provider); int icc_provider_add(struct icc_provider *provider); int icc_provider_del(struct icc_provider *provider); @@ -130,6 +131,11 @@ void icc_node_del(struct icc_node *node) { } +static inline int icc_nodes_remove(struct icc_provider *provider) +{ + return -ENOTSUPP; +} + static inline int icc_provider_add(struct icc_provider *provider) { return -ENOTSUPP; From patchwork Thu Nov 28 13:34:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 180426 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp157325ile; Thu, 28 Nov 2019 05:35:09 -0800 (PST) X-Google-Smtp-Source: APXvYqy/z8ettWk/28lqMVj3PEjE8ieb5rfYTToVmGoaPAYAjrvYiqaKC1BCR1naGp5CnF/AUN7O X-Received: by 2002:a17:906:c45:: with SMTP id t5mr53337279ejf.296.1574948109674; Thu, 28 Nov 2019 05:35:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574948109; cv=none; d=google.com; s=arc-20160816; b=klTkw1q1Vc8rmN/9WvtWhbNAuAEovd7DSGR2oO+E5N/6UgEdKdq6HkD5oCixbxTR+D zBgjJx9DqVsu04kG3bFT3Gq+lvk1unE1c2MOgVFxPgidh99y0JGgLEiQpakuxOUm9tV+ 9W0m/sA6iA/aLo4xK9zNyLeye+PvUEPzsATerU7Zj6JSKw3mycOiAz7cKDDMde5WdeE1 tErXxRGdZTsQtB1RvzvkVWMEE1ZTzGRrwNC9fRN2h7EyW5cROkMZ5tnV9GbSyR85GeMp j+0cH3v24pLxFGdYJI7fWaaOCE03Rab6NmaVhZ62c+PjRJtfV4xTklKNWpc0N/zXB5FC UgVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8VrphYeqahrQ5kATlO0grU5q+TZ5g96u9ghQO6Q2fFc=; b=PSTFoG5+lKlQC7QZAKjf7MdH3yA7ajRmgfM1tLr/gJQGN4FqigujsJn0zdXFCnM9Ok g+wcSm0T+fAWiVFh0XQdgjNIkYC7v2iHGyN4M/6exJXEW46bm1hKirBQYkdOTPC/b6We meJxkz2ki2CgCsQNWOQT0W0bIKa4akBKfsWKPcUhqfWjhaFccwBaVmyY0dSQelrA/Rh0 UrGanKdITpefpfBtSeAEIpmNNIJZ+4Y2wy8B0s3naWE5rs/pa30IQdQZaCm3c/zwRkxm kFhQ/DjNpUpZTo2Whb3P7D78k99Ck2PLM8pNncB/s079DB0aOcTPZjaEYBpZuaLLxchs 745g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w7KZ1TIq; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lu2si11617386ejb.83.2019.11.28.05.35.09; Thu, 28 Nov 2019 05:35:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w7KZ1TIq; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1726963AbfK1Nep (ORCPT + 10 others); Thu, 28 Nov 2019 08:34:45 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:50293 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726856AbfK1Nep (ORCPT ); Thu, 28 Nov 2019 08:34:45 -0500 Received: by mail-wm1-f68.google.com with SMTP id l17so11019556wmh.0 for ; Thu, 28 Nov 2019 05:34:43 -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=8VrphYeqahrQ5kATlO0grU5q+TZ5g96u9ghQO6Q2fFc=; b=w7KZ1TIqRorqFk6V1hPTFmPCV+1JsZnF6guXwmyWEmd2W7y9YMCY2uwvxnvykWSA6f OsOSqJsju0xA5ElMwpLTwVTRv+KgcOwVqfZccUsaSaxCRkyLOSj0qvii+PazYdpeCffQ IC4Xunj4UuQIFPzmkkZANHwXqAB64nMhMa+ixovKeNQUyJtjA9TjeYonMCz20PF1aonP A33R5BIWPqXSNyxyGTgTP0WYofOi2L1YNjBeTEXqgCAJH7ZCXxOuZP13AGhJLI9pqIqn ZeNR8Op/b22RzqQAWtf4p1HVMSovwHjxeyFFkV0+fLXM6lwm21OXN5OetG6ysGEnCuc/ o80A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8VrphYeqahrQ5kATlO0grU5q+TZ5g96u9ghQO6Q2fFc=; b=IjcOom8F6pUeDcgsU1tRDdLFKjU8PNBGPPW33oU3XdVcN9kPdyYaC7LWr5Co2JACpj AZl6k9xHhbzA6EI+dzDNWPGbD/FXQC70zCmLQ6YaLqesHsmJeu1wqU9Ooi74A2qc3J4H yjJ2J9moGdqKgGH9FKjEk3zKteHqAyIitb0HLz6jEm7Jpf6OcFI9P02Uq7Fgglr4Gljd MSH54/JqFlKtxo2DLrLywOvgrva0VpH16udnZaQB6vPsy3lI0NF4ZyU/37jISbpHCWW3 uYyDjLNLpKf5CG69VVQP6bTl755qLxj1fF2OQtBQRZEqFzI0Mjr/IYpDzknkNUWD0DvR 6gEw== X-Gm-Message-State: APjAAAXKg/6p5eNB2a+CVpaCuXBWojyNif5g13VTeUAJZG6AAmv3eRse eU4256hsivhM+DFQ4X6wJTE6YCHmNOc= X-Received: by 2002:a1c:1b88:: with SMTP id b130mr8979340wmb.4.1574948082044; Thu, 28 Nov 2019 05:34:42 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y20sm2220451wmi.25.2019.11.28.05.34.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Nov 2019 05:34:41 -0800 (PST) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: bjorn.andersson@linaro.org, agross@kernel.org, digetx@gmail.com, evgreen@chromium.org, daidavid1@codeaurora.org, masneyb@onstation.org, sibis@codeaurora.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH 5/5] interconnect: qcom: Use the new common helper for node removal Date: Thu, 28 Nov 2019 15:34:35 +0200 Message-Id: <20191128133435.25667-5-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191128133435.25667-1-georgi.djakov@linaro.org> References: <20191128133435.25667-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org There is a new helper function for removing all nodes. Let's use it instead of duplicating the code. In addition to the above, instead of duplicating the code, simplify the probe function error path by calling driver removal function directly. Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/msm8974.c | 40 ++++++++++------------------- drivers/interconnect/qcom/qcs404.c | 31 ++++++++-------------- drivers/interconnect/qcom/sdm845.c | 29 +++++++-------------- 3 files changed, 33 insertions(+), 67 deletions(-) diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c index 0a1a8ba6afa7..8823dce811c3 100644 --- a/drivers/interconnect/qcom/msm8974.c +++ b/drivers/interconnect/qcom/msm8974.c @@ -644,6 +644,15 @@ static int msm8974_icc_set(struct icc_node *src, struct icc_node *dst) return 0; } +static int msm8974_icc_remove(struct platform_device *pdev) +{ + struct msm8974_icc_provider *qp = platform_get_drvdata(pdev); + + icc_nodes_remove(&qp->provider); + clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); + return icc_provider_del(&qp->provider); +} + static int msm8974_icc_probe(struct platform_device *pdev) { const struct msm8974_icc_desc *desc; @@ -701,7 +710,8 @@ static int msm8974_icc_probe(struct platform_device *pdev) ret = icc_provider_add(provider); if (ret) { dev_err(dev, "error adding interconnect provider: %d\n", ret); - goto err_disable_clks; + clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); + return ret; } for (i = 0; i < num_nodes; i++) { @@ -710,7 +720,7 @@ static int msm8974_icc_probe(struct platform_device *pdev) node = icc_node_create(qnodes[i]->id); if (IS_ERR(node)) { ret = PTR_ERR(node); - goto err_del_icc; + goto err; } node->name = qnodes[i]->name; @@ -731,34 +741,12 @@ static int msm8974_icc_probe(struct platform_device *pdev) return 0; -err_del_icc: - list_for_each_entry_safe(node, &provider->nodes, node_list) { - icc_node_del(node); - icc_node_destroy(node->id); - } - icc_provider_del(provider); - -err_disable_clks: - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); +err: + msm8974_icc_remove(pdev); return ret; } -static int msm8974_icc_remove(struct platform_device *pdev) -{ - struct msm8974_icc_provider *qp = platform_get_drvdata(pdev); - struct icc_provider *provider = &qp->provider; - struct icc_node *n; - - list_for_each_entry_safe(n, &provider->nodes, node_list) { - icc_node_del(n); - icc_node_destroy(n->id); - } - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); - - return icc_provider_del(provider); -} - static const struct of_device_id msm8974_noc_of_match[] = { { .compatible = "qcom,msm8974-bimc", .data = &msm8974_bimc}, { .compatible = "qcom,msm8974-cnoc", .data = &msm8974_cnoc}, diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index d2b455021416..a4c6ba715f61 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -406,6 +406,15 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) return 0; } +static int qnoc_remove(struct platform_device *pdev) +{ + struct qcom_icc_provider *qp = platform_get_drvdata(pdev); + + clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); + icc_nodes_remove(&qp->provider); + return icc_provider_del(&qp->provider); +} + static int qnoc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -494,31 +503,11 @@ static int qnoc_probe(struct platform_device *pdev) return 0; err: - list_for_each_entry_safe(node, &provider->nodes, node_list) { - icc_node_del(node); - icc_node_destroy(node->id); - } - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); - icc_provider_del(provider); + qnoc_remove(pdev); return ret; } -static int qnoc_remove(struct platform_device *pdev) -{ - struct qcom_icc_provider *qp = platform_get_drvdata(pdev); - struct icc_provider *provider = &qp->provider; - struct icc_node *n; - - list_for_each_entry_safe(n, &provider->nodes, node_list) { - icc_node_del(n); - icc_node_destroy(n->id); - } - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); - - return icc_provider_del(provider); -} - static const struct of_device_id qcs404_noc_of_match[] = { { .compatible = "qcom,qcs404-bimc", .data = &qcs404_bimc }, { .compatible = "qcom,qcs404-pcnoc", .data = &qcs404_pcnoc }, diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index 924c2d056d85..2b8f13e78471 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -768,6 +768,14 @@ static int cmp_vcd(const void *_l, const void *_r) return 1; } +static int qnoc_remove(struct platform_device *pdev) +{ + struct qcom_icc_provider *qp = platform_get_drvdata(pdev); + + icc_nodes_remove(&qp->provider); + return icc_provider_del(&qp->provider); +} + static int qnoc_probe(struct platform_device *pdev) { const struct qcom_icc_desc *desc; @@ -855,29 +863,10 @@ static int qnoc_probe(struct platform_device *pdev) return ret; err: - list_for_each_entry(node, &provider->nodes, node_list) { - icc_node_del(node); - icc_node_destroy(node->id); - } - - icc_provider_del(provider); + qnoc_remove(pdev); return ret; } -static int qnoc_remove(struct platform_device *pdev) -{ - struct qcom_icc_provider *qp = platform_get_drvdata(pdev); - struct icc_provider *provider = &qp->provider; - struct icc_node *n; - - list_for_each_entry_safe(n, &provider->nodes, node_list) { - icc_node_del(n); - icc_node_destroy(n->id); - } - - return icc_provider_del(provider); -} - static const struct of_device_id qnoc_of_match[] = { { .compatible = "qcom,sdm845-rsc-hlos", .data = &sdm845_rsc_hlos }, { },