Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8841194ybl; Fri, 17 Jan 2020 02:01:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxwTFjFxqCXgQhemHJcbJsfsq+0fNNsJVgqYhgqHLSf8QwM7BvezeiaoGzeaaz4mwBml3Nt X-Received: by 2002:aca:ec93:: with SMTP id k141mr2617405oih.145.1579255264095; Fri, 17 Jan 2020 02:01:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579255264; cv=none; d=google.com; s=arc-20160816; b=zr3a5fvl/AIBfCIPtEp1EGKdg0g3vxfcmEUREOE/TVx3kVQtkaRwW0wjkR1dCNL0K9 w3Z3CeuYrZ0ZcPJ6guyHqae9LeCiQpPVlU0hvFo57rfIwkAi5A21+E1r5di18PPZqHuD qODHqi9rye7AS7OOmRqlwWEY4pjD2FA6X9aKcHYZvSqiIs1EGx1rE6Mq1fqax8+odmLi GXbNtLnxuGgRC/x+MiyfowbPjReSa7nBxqIYfCxDGZb3CLYbjue1ZS1MDo7iOTkND1g/ acsNtjfFSu7xusa9AndMwTSwBqczq1fLP2/qh6g8Xho4RVS90+nz7I6Z/6GxXuWv9qx2 Xseg== 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=jckVpy+7MLaoCGpB18Y5CDbGaFI7k6lN9q4aC94sn/w=; b=yWlomMxHLtJ0H2TnumqpOOyJNQwljWcTtBJw4Eh3AQtsQj/Ddzc1tPIltc+O0ZnIc5 Xm2vDyNvos2gnJFR4sHSFo7uEBnswAMteZ0YaQm5AKqHiVTeCYCh3+tjGr9KnrvavMbQ FfcxWz6SDwEehaMMN5njl1Prp4pawjdhwxGniiqXBs3Se5LQuGDfNe8tea7PuFWDsJ2L chopN8iQ7oAsJQbBZd0KoQtTkjm368pbxzWPt8Uiy9bA1LtVXT6H2jzBVRcWWgp3lwjU vZKcakaU+hFpeSKWhhb+4ETK3TN4H7pGcHSZPiAX6ed9tLa8hFQ9m5FR0tbj9v1aulhV tmGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a7F+4Nza; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si12524264otf.81.2020.01.17.02.00.52; Fri, 17 Jan 2020 02:01:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=a7F+4Nza; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727531AbgAQJ72 (ORCPT + 99 others); Fri, 17 Jan 2020 04:59:28 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33105 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgAQJ6W (ORCPT ); Fri, 17 Jan 2020 04:58:22 -0500 Received: by mail-wr1-f65.google.com with SMTP id b6so22087169wrq.0 for ; Fri, 17 Jan 2020 01:58:21 -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=jckVpy+7MLaoCGpB18Y5CDbGaFI7k6lN9q4aC94sn/w=; b=a7F+4NzaG6nErX9ZFsm8pI50tYua1LxgJ05Mid/gl91bgJv9k2cZUC4HWmck1C5Gk1 SclLphlGq6kgHE0LY/FT7BCZgshPB+umWygv/bMdEboZ90rsmeOfEynEEdZWo4WAQd45 3DJaLic6/Ocjjw27DmcBoa4wylG2EJpWMh6ysUpzEq54OyKZdCmb+tV+117gt2KjQTiC 7g7b0VNvSkvv5WF7peAlIxwHcFgJjpHoeU6t8g0AR78gcmWEuLAJjzIjaUOJVxpK2/N6 rhYPUnE6dcjba/K7YSzMryn/z50xvMSmcWfTJvSvCkpXRcQKkcH969T1K1GdufkzSulg OpBw== 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=jckVpy+7MLaoCGpB18Y5CDbGaFI7k6lN9q4aC94sn/w=; b=dla1LMRcD8wNRFhYQi29T4YiSjGLVvrE+OnQVAIMgNMNjE1ah/3cFIfOGixcJMQJns RLFn68NN+jmYjChHu61G78MTkGcVroFCF4IDS1OISDOZu+gsgqUbeF0EgmDxagAy2LY8 8PGhKtV/UAQgVS1H+EcEE5nduWy036lolwC2EfOJnKvolMrXXzGq43RYByL/8/la7sRB PgSshkMt9g9WswyOOKLGQa9aJvB6ki45RAcfhIH9+VQrtee9RtycUXiCqPaCLEKXJlDM s7G0SVMvYmcrKHZGrUFFFZlDBGRrwtCZ2AB6/a1KOKCsDQEK45sqXNhoDL9FXkqvCzr8 mrUA== X-Gm-Message-State: APjAAAVeJC5NiZvBY2I6e9cp6g6Brx9oFMxT9FG5SISEz1lNwuPscnP+ g3BYWEBjl7HMexFzvcPcZnpQ5Q== X-Received: by 2002:adf:bc87:: with SMTP id g7mr2181235wrh.121.1579255100900; Fri, 17 Jan 2020 01:58:20 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id r62sm9967007wma.32.2020.01.17.01.58.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jan 2020 01:58:20 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Georgi Djakov , Bjorn Andersson Subject: [PATCH 02/12] interconnect: qcom: Use the new common helper for node removal Date: Fri, 17 Jan 2020 11:58:06 +0200 Message-Id: <20200117095816.23575-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117095816.23575-1-georgi.djakov@linaro.org> References: <20200117095816.23575-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a new helper function for removing all nodes. Let's use it instead of duplicating the code. Reviewed-by: Bjorn Andersson Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/msm8974.c | 17 ++++------------- drivers/interconnect/qcom/qcs404.c | 17 ++++------------- drivers/interconnect/qcom/sdm845.c | 16 +++------------- 3 files changed, 11 insertions(+), 39 deletions(-) diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c index bf8bd1aee358..e669a1f726d2 100644 --- a/drivers/interconnect/qcom/msm8974.c +++ b/drivers/interconnect/qcom/msm8974.c @@ -652,7 +652,7 @@ static int msm8974_icc_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct icc_onecell_data *data; struct icc_provider *provider; - struct icc_node *node, *tmp; + struct icc_node *node; size_t num_nodes, i; int ret; @@ -732,10 +732,7 @@ static int msm8974_icc_probe(struct platform_device *pdev) return 0; err_del_icc: - list_for_each_entry_safe(node, tmp, &provider->nodes, node_list) { - icc_node_del(node); - icc_node_destroy(node->id); - } + icc_nodes_remove(provider); icc_provider_del(provider); err_disable_clks: @@ -747,16 +744,10 @@ static int msm8974_icc_probe(struct platform_device *pdev) 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, *tmp; - list_for_each_entry_safe(n, tmp, &provider->nodes, node_list) { - icc_node_del(n); - icc_node_destroy(n->id); - } + icc_nodes_remove(&qp->provider); clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); - - return icc_provider_del(provider); + return icc_provider_del(&qp->provider); } static const struct of_device_id msm8974_noc_of_match[] = { diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index 8e0735a87040..c8eb1276cce8 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -414,7 +414,7 @@ static int qnoc_probe(struct platform_device *pdev) struct icc_provider *provider; struct qcom_icc_node **qnodes; struct qcom_icc_provider *qp; - struct icc_node *node, *tmp; + struct icc_node *node; size_t num_nodes, i; int ret; @@ -494,10 +494,7 @@ static int qnoc_probe(struct platform_device *pdev) return 0; err: - list_for_each_entry_safe(node, tmp, &provider->nodes, node_list) { - icc_node_del(node); - icc_node_destroy(node->id); - } + icc_nodes_remove(provider); clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); icc_provider_del(provider); @@ -507,16 +504,10 @@ static int qnoc_probe(struct platform_device *pdev) 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, *tmp; - list_for_each_entry_safe(n, tmp, &provider->nodes, node_list) { - icc_node_del(n); - icc_node_destroy(n->id); - } + icc_nodes_remove(&qp->provider); clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); - - return icc_provider_del(provider); + return icc_provider_del(&qp->provider); } static const struct of_device_id qcs404_noc_of_match[] = { diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index 387267ee9648..f078cf0fce56 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -855,11 +855,7 @@ 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_nodes_remove(provider); icc_provider_del(provider); return ret; } @@ -867,15 +863,9 @@ static int qnoc_probe(struct platform_device *pdev) 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, *tmp; - - list_for_each_entry_safe(n, tmp, &provider->nodes, node_list) { - icc_node_del(n); - icc_node_destroy(n->id); - } - return icc_provider_del(provider); + icc_nodes_remove(&qp->provider); + return icc_provider_del(&qp->provider); } static const struct of_device_id qnoc_of_match[] = {