[PATCH 04/53] interconnect: qcom: icc-rpmh: Retire dead code

From: Konrad Dybcio
Date: Tue Jul 11 2023 - 08:18:59 EST


of_bcm_voter_get is no longer necessary. Remove its ugly remnants.

Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>
---
drivers/interconnect/qcom/bcm-voter.c | 46 -----------------------------------
drivers/interconnect/qcom/bcm-voter.h | 1 -
2 files changed, 47 deletions(-)

diff --git a/drivers/interconnect/qcom/bcm-voter.c b/drivers/interconnect/qcom/bcm-voter.c
index f8fbddb87e6b..0ce3874f60d2 100644
--- a/drivers/interconnect/qcom/bcm-voter.c
+++ b/drivers/interconnect/qcom/bcm-voter.c
@@ -16,7 +16,6 @@
#include "bcm-voter.h"
#include "icc-rpmh.h"

-static LIST_HEAD(bcm_voters);
static DEFINE_MUTEX(bcm_voter_lock);

struct bcm_voter *qcom_icc_bcm_voters[ICC_BCM_VOTER_MAX] = { };
@@ -182,51 +181,6 @@ static void tcs_list_gen(struct bcm_voter *voter, int bucket,
}
}

-/**
- * of_bcm_voter_get - gets a bcm voter handle from DT node
- * @dev: device pointer for the consumer device
- * @name: name for the bcm voter device
- *
- * This function will match a device_node pointer for the phandle
- * specified in the device DT and return a bcm_voter handle on success.
- *
- * Returns bcm_voter pointer or ERR_PTR() on error. EPROBE_DEFER is returned
- * when matching bcm voter is yet to be found.
- */
-struct bcm_voter *of_bcm_voter_get(struct device *dev, const char *name)
-{
- struct bcm_voter *voter = ERR_PTR(-EPROBE_DEFER);
- struct bcm_voter *temp;
- struct device_node *np, *node;
- int idx = 0;
-
- if (!dev || !dev->of_node)
- return ERR_PTR(-ENODEV);
-
- np = dev->of_node;
-
- if (name) {
- idx = of_property_match_string(np, "qcom,bcm-voter-names", name);
- if (idx < 0)
- return ERR_PTR(idx);
- }
-
- node = of_parse_phandle(np, "qcom,bcm-voters", idx);
-
- mutex_lock(&bcm_voter_lock);
- list_for_each_entry(temp, &bcm_voters, voter_node) {
- if (temp->np == node) {
- voter = temp;
- break;
- }
- }
- mutex_unlock(&bcm_voter_lock);
-
- of_node_put(node);
- return voter;
-}
-EXPORT_SYMBOL_GPL(of_bcm_voter_get);
-
/**
* qcom_icc_bcm_voter_add - queues up the bcm nodes that require updates
* @voter: voter that the bcms are being added to
diff --git a/drivers/interconnect/qcom/bcm-voter.h b/drivers/interconnect/qcom/bcm-voter.h
index 0f64c0bab2c0..30b324fcb2ee 100644
--- a/drivers/interconnect/qcom/bcm-voter.h
+++ b/drivers/interconnect/qcom/bcm-voter.h
@@ -20,7 +20,6 @@ static struct qcom_icc_bcm _name = { \
.nodes = { __VA_ARGS__ }, \
}

-struct bcm_voter *of_bcm_voter_get(struct device *dev, const char *name);
void qcom_icc_bcm_voter_add(struct bcm_voter *voter, struct qcom_icc_bcm *bcm);
int qcom_icc_bcm_voter_commit(struct bcm_voter *voter);


--
2.41.0