summaryrefslogtreecommitdiff
path: root/arch/arm/mach-versatile/spc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-versatile/spc.c')
-rw-r--r--arch/arm/mach-versatile/spc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/arm/mach-versatile/spc.c b/arch/arm/mach-versatile/spc.c
index 790092734cf6..7c3191aa3e12 100644
--- a/arch/arm/mach-versatile/spc.c
+++ b/arch/arm/mach-versatile/spc.c
@@ -395,7 +395,7 @@ static int ve_spc_populate_opps(uint32_t cluster)
uint32_t data = 0, off, ret, idx;
struct ve_spc_opp *opps;
- opps = kcalloc(MAX_OPPS, sizeof(*opps), GFP_KERNEL);
+ opps = kzalloc_objs(*opps, MAX_OPPS);
if (!opps)
return -ENOMEM;
@@ -442,7 +442,7 @@ static int ve_init_opp_table(struct device *cpu_dev)
int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid, int irq)
{
int ret;
- info = kzalloc(sizeof(*info), GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;
@@ -459,8 +459,8 @@ int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid, int irq)
readl_relaxed(info->baseaddr + PWC_STATUS);
- ret = request_irq(irq, ve_spc_irq_handler, IRQF_TRIGGER_HIGH
- | IRQF_ONESHOT, "vexpress-spc", info);
+ ret = request_irq(irq, ve_spc_irq_handler, IRQF_TRIGGER_HIGH,
+ "vexpress-spc", info);
if (ret) {
pr_err(SPCLOG "IRQ %d request failed\n", irq);
kfree(info);
@@ -497,12 +497,13 @@ static unsigned long spc_recalc_rate(struct clk_hw *hw,
return freq * 1000;
}
-static long spc_round_rate(struct clk_hw *hw, unsigned long drate,
- unsigned long *parent_rate)
+static int spc_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
{
struct clk_spc *spc = to_clk_spc(hw);
- return ve_spc_round_performance(spc->cluster, drate);
+ req->rate = ve_spc_round_performance(spc->cluster, req->rate);
+
+ return 0;
}
static int spc_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -515,7 +516,7 @@ static int spc_set_rate(struct clk_hw *hw, unsigned long rate,
static struct clk_ops clk_spc_ops = {
.recalc_rate = spc_recalc_rate,
- .round_rate = spc_round_rate,
+ .determine_rate = spc_determine_rate,
.set_rate = spc_set_rate,
};
@@ -524,7 +525,7 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev)
struct clk_init_data init;
struct clk_spc *spc;
- spc = kzalloc(sizeof(*spc), GFP_KERNEL);
+ spc = kzalloc_obj(*spc);
if (!spc)
return ERR_PTR(-ENOMEM);