Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1698551
| From | Kiran Gunda <kgunda@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH V2 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function |
| Date | 2017-07-28 09:20 +0200 |
| Message-ID | <u87J1-CM-29@gated-at.bofh.it> (permalink) |
| References | <u87IZ-CM-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Clean up the pmic_arb_find_apid() by using the local
variables to improve the code readability.
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
---
drivers/spmi/spmi-pmic-arb.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 530fa11..530d410 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -762,23 +762,22 @@ static int pmic_arb_offset_v1(struct spmi_pmic_arb *pmic_arb, u8 sid, u16 addr,
static u16 pmic_arb_find_apid(struct spmi_pmic_arb *pmic_arb, u16 ppid)
{
+ struct apid_data *apidd = &pmic_arb->apid_data[pmic_arb->last_apid];
u32 regval, offset;
- u16 apid;
- u16 id;
+ u16 id, apid;
/*
- * PMIC_ARB_REG_CHNL is a table in HW mapping channel to ppid.
+ * PMIC_ARB_REG_APID is a table in HW mapping apid to ppid.
* ppid_to_apid is an in-memory invert of that table.
*/
- for (apid = pmic_arb->last_apid; ; apid++) {
+ for (apid = pmic_arb->last_apid; ; apid++, apidd++) {
offset = PMIC_ARB_REG_APID(apid);
if (offset >= pmic_arb->core_size)
break;
regval = readl_relaxed(pmic_arb->cnfg +
SPMI_OWNERSHIP_TABLE_REG(apid));
- pmic_arb->apid_data[apid].owner =
- SPMI_OWNERSHIP_PERIPH2OWNER(regval);
+ apidd->owner = SPMI_OWNERSHIP_PERIPH2OWNER(regval);
regval = readl_relaxed(pmic_arb->core + offset);
if (!regval)
@@ -786,7 +785,7 @@ static u16 pmic_arb_find_apid(struct spmi_pmic_arb *pmic_arb, u16 ppid)
id = (regval >> 8) & PMIC_ARB_PPID_MASK;
pmic_arb->ppid_to_apid[id] = apid | PMIC_ARB_APID_VALID;
- pmic_arb->apid_data[apid].ppid = id;
+ apidd->ppid = id;
if (id == ppid) {
apid |= PMIC_ARB_APID_VALID;
break;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 00/12]: spmi: pmic-arb: Support for HW v5 and other fixes Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200 [PATCH V2 04/12] spmi: pmic-arb: optimize qpnpint_irq_set_type function Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200 [PATCH V2 06/12] spmi: pmic-arb: replace the writel_relaxed with __raw_writel Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200 [PATCH V2 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200 [PATCH V2 01/12] spmi: pmic-arb: remove the read/write access checks Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200 [PATCH V2 11/12] spmi: pmic-arb: add support for HW version 5 Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200 [PATCH V2 05/12] spmi: pmic-arb: fix memory allocation for mapping_table Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200 [PATCH V2 12/12] spmi: pmic-arb: Remove checking opc value not less than 0 Kiran Gunda <kgunda@codeaurora.org> - 2017-07-28 09:20 +0200
csiph-web