mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 00:56:20 +01:00
clk: at91: peripheral: fix return value
determine_rate() is expected to return an error code, or 0 on success.
clk_sam9x5_peripheral_determine_rate() has a branch that returns the
parent rate on a certain case. This is the behavior of round_rate(),
so let's go ahead and fix this by setting req->rate.
Fixes: b4c115c761 ("clk: at91: clk-peripheral: add support for changeable parent rate")
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
0f9cf96a01
commit
47b13635da
1 changed files with 5 additions and 2 deletions
|
|
@ -279,8 +279,11 @@ static int clk_sam9x5_peripheral_determine_rate(struct clk_hw *hw,
|
|||
long best_diff = LONG_MIN;
|
||||
u32 shift;
|
||||
|
||||
if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max)
|
||||
return parent_rate;
|
||||
if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max) {
|
||||
req->rate = parent_rate;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Fist step: check the available dividers. */
|
||||
for (shift = 0; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue