Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299756
b: refs/heads/master
c: ea505bc
h: refs/heads/master
v: v3
  • Loading branch information
Viresh Kumar authored and Grant Likely committed Apr 27, 2012
1 parent c7755bf commit 6422711
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88a3a255a510ed193bf0cc35424761c3c9247586
refs/heads/master: ea505bc99f77f3f9db02bb965bd59ac5db063f60
10 changes: 8 additions & 2 deletions trunk/drivers/spi/spi-pl022.c
Original file line number Diff line number Diff line change
Expand Up @@ -1667,9 +1667,15 @@ static int calculate_effective_freq(struct pl022 *pl022, int freq, struct
/* cpsdvsr = 254 & scr = 255 */
min_tclk = spi_rate(rate, CPSDVR_MAX, SCR_MAX);

if (!((freq <= max_tclk) && (freq >= min_tclk))) {
if (freq > max_tclk)
dev_warn(&pl022->adev->dev,
"Max speed that can be programmed is %d Hz, you requested %d\n",
max_tclk, freq);

if (freq < min_tclk) {
dev_err(&pl022->adev->dev,
"controller data is incorrect: out of range frequency");
"Requested frequency: %d Hz is less than minimum possible %d Hz\n",
freq, min_tclk);
return -EINVAL;
}

Expand Down

0 comments on commit 6422711

Please sign in to comment.