netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ssb: fix handling of ssb_pmu_get_alp_clock()
@ 2015-06-06 23:52 Hauke Mehrtens
  2015-06-07  7:02 ` Michael Büsch
  0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2015-06-06 23:52 UTC (permalink / raw)
  To: m, davem; +Cc: netdev, linux-mips, Hauke Mehrtens

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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/ssb/driver_chipcommon_pmu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ssb/driver_chipcommon_pmu.c b/drivers/ssb/driver_chipcommon_pmu.c
index 0942841..c5352ea 100644
--- a/drivers/ssb/driver_chipcommon_pmu.c
+++ b/drivers/ssb/driver_chipcommon_pmu.c
@@ -621,8 +621,8 @@ static u32 ssb_pmu_get_alp_clock_clk0(struct ssb_chipcommon *cc)
 	u32 crystalfreq;
 	const struct pmu0_plltab_entry *e = NULL;
 
-	crystalfreq = chipco_read32(cc, SSB_CHIPCO_PMU_CTL) &
-		      SSB_CHIPCO_PMU_CTL_XTALFREQ >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT;
+	crystalfreq = (chipco_read32(cc, SSB_CHIPCO_PMU_CTL) &
+		       SSB_CHIPCO_PMU_CTL_XTALFREQ)  >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT;
 	e = pmu0_plltab_find_entry(crystalfreq);
 	BUG_ON(!e);
 	return e->freq * 1000;
@@ -634,7 +634,7 @@ u32 ssb_pmu_get_alp_clock(struct ssb_chipcommon *cc)
 
 	switch (bus->chip_id) {
 	case 0x5354:
-		ssb_pmu_get_alp_clock_clk0(cc);
+		return ssb_pmu_get_alp_clock_clk0(cc);
 	default:
 		ssb_err("ERROR: PMU alp clock unknown for device %04X\n",
 			bus->chip_id);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ssb: fix handling of ssb_pmu_get_alp_clock()
  2015-06-06 23:52 [PATCH] ssb: fix handling of ssb_pmu_get_alp_clock() Hauke Mehrtens
@ 2015-06-07  7:02 ` Michael Büsch
  2015-06-09  7:04   ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Büsch @ 2015-06-07  7:02 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: davem, netdev, linux-mips

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

On Sun,  7 Jun 2015 01:52:51 +0200
Hauke Mehrtens <hauke@hauke-m.de> wrote:

> 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: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  drivers/ssb/driver_chipcommon_pmu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ssb/driver_chipcommon_pmu.c b/drivers/ssb/driver_chipcommon_pmu.c
> index 0942841..c5352ea 100644
> --- a/drivers/ssb/driver_chipcommon_pmu.c
> +++ b/drivers/ssb/driver_chipcommon_pmu.c
> @@ -621,8 +621,8 @@ static u32 ssb_pmu_get_alp_clock_clk0(struct ssb_chipcommon *cc)
>  	u32 crystalfreq;
>  	const struct pmu0_plltab_entry *e = NULL;
>  
> -	crystalfreq = chipco_read32(cc, SSB_CHIPCO_PMU_CTL) &
> -		      SSB_CHIPCO_PMU_CTL_XTALFREQ >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT;
> +	crystalfreq = (chipco_read32(cc, SSB_CHIPCO_PMU_CTL) &
> +		       SSB_CHIPCO_PMU_CTL_XTALFREQ)  >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT;
>  	e = pmu0_plltab_find_entry(crystalfreq);
>  	BUG_ON(!e);
>  	return e->freq * 1000;
> @@ -634,7 +634,7 @@ u32 ssb_pmu_get_alp_clock(struct ssb_chipcommon *cc)
>  
>  	switch (bus->chip_id) {
>  	case 0x5354:
> -		ssb_pmu_get_alp_clock_clk0(cc);
> +		return ssb_pmu_get_alp_clock_clk0(cc);
>  	default:
>  		ssb_err("ERROR: PMU alp clock unknown for device %04X\n",
>  			bus->chip_id);

Looks good.
Signed-off-by: Michael Buesch <m@bues.ch>

Can some MIPS people take this, please?

-- 
Michael

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ssb: fix handling of ssb_pmu_get_alp_clock()
  2015-06-07  7:02 ` Michael Büsch
@ 2015-06-09  7:04   ` Ralf Baechle
  0 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2015-06-09  7:04 UTC (permalink / raw)
  To: Michael Büsch; +Cc: Hauke Mehrtens, davem, netdev, linux-mips

On Sun, Jun 07, 2015 at 09:02:23AM +0200, Michael Büsch wrote:

> Signed-off-by: Michael Buesch <m@bues.ch>
> 
> Can some MIPS people take this, please?

Will do, as usual.  Unfortunately this missed my last pull request so
it's going to Linus by the end of the week.

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-09  7:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-06 23:52 [PATCH] ssb: fix handling of ssb_pmu_get_alp_clock() Hauke Mehrtens
2015-06-07  7:02 ` Michael Büsch
2015-06-09  7:04   ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).