mirror of https://github.com/torvalds/linux.git
MIPS: Alchemy: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from round_rate() to determine_rate() using the Coccinelle semantic patch appended to the "under-the-cut" portion of the patch. Note that prior to running Coccinelle, alchemy_clk_aux_roundr() was renamed to alchemy_clk_aux_round_rate(). A few minor style cleanups were also done by hand. Signed-off-by: Brian Masney <bmasney@redhat.com> Tested-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
parent
157f9533f9
commit
dba4380504
|
|
@ -211,30 +211,34 @@ static int alchemy_clk_aux_setr(struct clk_hw *hw,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long alchemy_clk_aux_roundr(struct clk_hw *hw,
|
static int alchemy_clk_aux_determine_rate(struct clk_hw *hw,
|
||||||
unsigned long rate,
|
struct clk_rate_request *req)
|
||||||
unsigned long *parent_rate)
|
|
||||||
{
|
{
|
||||||
struct alchemy_auxpll_clk *a = to_auxpll_clk(hw);
|
struct alchemy_auxpll_clk *a = to_auxpll_clk(hw);
|
||||||
unsigned long mult;
|
unsigned long mult;
|
||||||
|
|
||||||
if (!rate || !*parent_rate)
|
if (!req->rate || !req->best_parent_rate) {
|
||||||
return 0;
|
req->rate = 0;
|
||||||
|
|
||||||
mult = rate / (*parent_rate);
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mult = req->rate / req->best_parent_rate;
|
||||||
|
|
||||||
if (mult && (mult < 7))
|
if (mult && (mult < 7))
|
||||||
mult = 7;
|
mult = 7;
|
||||||
if (mult > a->maxmult)
|
if (mult > a->maxmult)
|
||||||
mult = a->maxmult;
|
mult = a->maxmult;
|
||||||
|
|
||||||
return (*parent_rate) * mult;
|
req->rate = req->best_parent_rate * mult;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct clk_ops alchemy_clkops_aux = {
|
static const struct clk_ops alchemy_clkops_aux = {
|
||||||
.recalc_rate = alchemy_clk_aux_recalc,
|
.recalc_rate = alchemy_clk_aux_recalc,
|
||||||
.set_rate = alchemy_clk_aux_setr,
|
.set_rate = alchemy_clk_aux_setr,
|
||||||
.round_rate = alchemy_clk_aux_roundr,
|
.determine_rate = alchemy_clk_aux_determine_rate,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct clk __init *alchemy_clk_setup_aux(const char *parent_name,
|
static struct clk __init *alchemy_clk_setup_aux(const char *parent_name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue