interconnect: qcom: Fix re-initializing the bcm

Currently, qcom_icc_bcm_init always assumes the bcm is not initialized.
There is a possibility that same bcm can belong to multiple providers
and re-initing the bcm adds the same bcm multiple times to the nodes
which are under the control of the bcm.
Hence add condition to check for bcm inited.

Change-Id: I3961963a6ef1a7b76d7ab708f648146fe1a30c99
Signed-off-by: Veera Vegivada <vvegivad@codeaurora.org>
This commit is contained in:
Veera Vegivada 2021-01-17 22:44:28 +05:30
commit cd30d2af63

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
*
*/
@ -131,6 +131,10 @@ int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev)
size_t data_count;
int i;
/* BCM is already initialised*/
if (bcm->addr)
return 0;
bcm->addr = cmd_db_read_addr(bcm->name);
if (!bcm->addr) {
dev_err(dev, "%s could not find RPMh address\n",