Commit 36f6ea2b authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by Ralf Baechle

SSB: Fix handling of ssb_pmu_get_alp_clock()

Dan Carpenter reported missing brackets which resulted in reading a
wrong crystalfreq value. I also noticed that the result of this
function is ignored.
Reported-By: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarMichael Buesch <m@bues.ch>
Cc: davem@davemloft.net
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10536/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent d7b63141
...@@ -621,8 +621,8 @@ static u32 ssb_pmu_get_alp_clock_clk0(struct ssb_chipcommon *cc) ...@@ -621,8 +621,8 @@ static u32 ssb_pmu_get_alp_clock_clk0(struct ssb_chipcommon *cc)
u32 crystalfreq; u32 crystalfreq;
const struct pmu0_plltab_entry *e = NULL; const struct pmu0_plltab_entry *e = NULL;
crystalfreq = chipco_read32(cc, SSB_CHIPCO_PMU_CTL) & crystalfreq = (chipco_read32(cc, SSB_CHIPCO_PMU_CTL) &
SSB_CHIPCO_PMU_CTL_XTALFREQ >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT; SSB_CHIPCO_PMU_CTL_XTALFREQ) >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT;
e = pmu0_plltab_find_entry(crystalfreq); e = pmu0_plltab_find_entry(crystalfreq);
BUG_ON(!e); BUG_ON(!e);
return e->freq * 1000; return e->freq * 1000;
...@@ -634,7 +634,7 @@ u32 ssb_pmu_get_alp_clock(struct ssb_chipcommon *cc) ...@@ -634,7 +634,7 @@ u32 ssb_pmu_get_alp_clock(struct ssb_chipcommon *cc)
switch (bus->chip_id) { switch (bus->chip_id) {
case 0x5354: case 0x5354:
ssb_pmu_get_alp_clock_clk0(cc); return ssb_pmu_get_alp_clock_clk0(cc);
default: default:
ssb_err("ERROR: PMU alp clock unknown for device %04X\n", ssb_err("ERROR: PMU alp clock unknown for device %04X\n",
bus->chip_id); bus->chip_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment