diff options
author | Heiko Stuebner <heiko@sntech.de> | 2016-04-19 15:29:27 -0400 |
---|---|---|
committer | Heiko Stuebner <heiko@sntech.de> | 2016-04-20 03:53:39 -0400 |
commit | 03ae1747869437a8e4d0d4e79d4c88c25c6df39c (patch) | |
tree | e76c03de68ab8e7e23c63812763ca8ff435eb713 | |
parent | 2b4e6286484c3eeae2c80063c510166c63d7cb85 (diff) |
clk: rockchip: fix checkpatch warning in core code
We seem to have accumulated a bunch of checkpatch warnings, with mainly
overlong lines and two unnecessary allocation error messages.
Most were introduced with the recent multi-controller-support but some
were quite a bit older.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-rw-r--r-- | drivers/clk/rockchip/clk-mmc-phase.c | 3 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk.c | 44 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk.h | 2 |
3 files changed, 27 insertions, 22 deletions
diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c index e0dc7e83403a..bc856f21f6b2 100644 --- a/drivers/clk/rockchip/clk-mmc-phase.c +++ b/drivers/clk/rockchip/clk-mmc-phase.c | |||
@@ -123,7 +123,8 @@ static int rockchip_mmc_set_phase(struct clk_hw *hw, int degrees) | |||
123 | raw_value = delay_num ? ROCKCHIP_MMC_DELAY_SEL : 0; | 123 | raw_value = delay_num ? ROCKCHIP_MMC_DELAY_SEL : 0; |
124 | raw_value |= delay_num << ROCKCHIP_MMC_DELAYNUM_OFFSET; | 124 | raw_value |= delay_num << ROCKCHIP_MMC_DELAYNUM_OFFSET; |
125 | raw_value |= nineties; | 125 | raw_value |= nineties; |
126 | writel(HIWORD_UPDATE(raw_value, 0x07ff, mmc_clock->shift), mmc_clock->reg); | 126 | writel(HIWORD_UPDATE(raw_value, 0x07ff, mmc_clock->shift), |
127 | mmc_clock->reg); | ||
127 | 128 | ||
128 | pr_debug("%s->set_phase(%d) delay_nums=%u reg[0x%p]=0x%03x actual_degrees=%d\n", | 129 | pr_debug("%s->set_phase(%d) delay_nums=%u reg[0x%p]=0x%03x actual_degrees=%d\n", |
129 | clk_hw_get_name(hw), degrees, delay_num, | 130 | clk_hw_get_name(hw), degrees, delay_num, |
diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index 277f9270bf72..f0a8be1553b0 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c | |||
@@ -42,7 +42,8 @@ | |||
42 | * sometimes without one of those components. | 42 | * sometimes without one of those components. |
43 | */ | 43 | */ |
44 | static struct clk *rockchip_clk_register_branch(const char *name, | 44 | static struct clk *rockchip_clk_register_branch(const char *name, |
45 | const char *const *parent_names, u8 num_parents, void __iomem *base, | 45 | const char *const *parent_names, u8 num_parents, |
46 | void __iomem *base, | ||
46 | int muxdiv_offset, u8 mux_shift, u8 mux_width, u8 mux_flags, | 47 | int muxdiv_offset, u8 mux_shift, u8 mux_width, u8 mux_flags, |
47 | u8 div_shift, u8 div_width, u8 div_flags, | 48 | u8 div_shift, u8 div_width, u8 div_flags, |
48 | struct clk_div_table *div_table, int gate_offset, | 49 | struct clk_div_table *div_table, int gate_offset, |
@@ -139,9 +140,11 @@ static int rockchip_clk_frac_notifier_cb(struct notifier_block *nb, | |||
139 | pr_debug("%s: event %lu, old_rate %lu, new_rate: %lu\n", | 140 | pr_debug("%s: event %lu, old_rate %lu, new_rate: %lu\n", |
140 | __func__, event, ndata->old_rate, ndata->new_rate); | 141 | __func__, event, ndata->old_rate, ndata->new_rate); |
141 | if (event == PRE_RATE_CHANGE) { | 142 | if (event == PRE_RATE_CHANGE) { |
142 | frac->rate_change_idx = frac->mux_ops->get_parent(&frac_mux->hw); | 143 | frac->rate_change_idx = |
144 | frac->mux_ops->get_parent(&frac_mux->hw); | ||
143 | if (frac->rate_change_idx != frac->mux_frac_idx) { | 145 | if (frac->rate_change_idx != frac->mux_frac_idx) { |
144 | frac->mux_ops->set_parent(&frac_mux->hw, frac->mux_frac_idx); | 146 | frac->mux_ops->set_parent(&frac_mux->hw, |
147 | frac->mux_frac_idx); | ||
145 | frac->rate_change_remuxed = 1; | 148 | frac->rate_change_remuxed = 1; |
146 | } | 149 | } |
147 | } else if (event == POST_RATE_CHANGE) { | 150 | } else if (event == POST_RATE_CHANGE) { |
@@ -152,7 +155,8 @@ static int rockchip_clk_frac_notifier_cb(struct notifier_block *nb, | |||
152 | * reaches the mux itself. | 155 | * reaches the mux itself. |
153 | */ | 156 | */ |
154 | if (frac->rate_change_remuxed) { | 157 | if (frac->rate_change_remuxed) { |
155 | frac->mux_ops->set_parent(&frac_mux->hw, frac->rate_change_idx); | 158 | frac->mux_ops->set_parent(&frac_mux->hw, |
159 | frac->rate_change_idx); | ||
156 | frac->rate_change_remuxed = 0; | 160 | frac->rate_change_remuxed = 0; |
157 | } | 161 | } |
158 | } | 162 | } |
@@ -326,18 +330,12 @@ struct rockchip_clk_provider * __init rockchip_clk_init(struct device_node *np, | |||
326 | int i; | 330 | int i; |
327 | 331 | ||
328 | ctx = kzalloc(sizeof(struct rockchip_clk_provider), GFP_KERNEL); | 332 | ctx = kzalloc(sizeof(struct rockchip_clk_provider), GFP_KERNEL); |
329 | if (!ctx) { | 333 | if (!ctx) |
330 | pr_err("%s: Could not allocate clock provider context\n", | ||
331 | __func__); | ||
332 | return ERR_PTR(-ENOMEM); | 334 | return ERR_PTR(-ENOMEM); |
333 | } | ||
334 | 335 | ||
335 | clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL); | 336 | clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL); |
336 | if (!clk_table) { | 337 | if (!clk_table) |
337 | pr_err("%s: Could not allocate clock lookup table\n", | ||
338 | __func__); | ||
339 | goto err_free; | 338 | goto err_free; |
340 | } | ||
341 | 339 | ||
342 | for (i = 0; i < nr_clks; ++i) | 340 | for (i = 0; i < nr_clks; ++i) |
343 | clk_table[i] = ERR_PTR(-ENOENT); | 341 | clk_table[i] = ERR_PTR(-ENOENT); |
@@ -367,7 +365,8 @@ void __init rockchip_clk_of_add_provider(struct device_node *np, | |||
367 | struct regmap *rockchip_clk_get_grf(struct rockchip_clk_provider *ctx) | 365 | struct regmap *rockchip_clk_get_grf(struct rockchip_clk_provider *ctx) |
368 | { | 366 | { |
369 | if (IS_ERR(ctx->grf)) | 367 | if (IS_ERR(ctx->grf)) |
370 | ctx->grf = syscon_regmap_lookup_by_phandle(ctx->cru_node, "rockchip,grf"); | 368 | ctx->grf = syscon_regmap_lookup_by_phandle(ctx->cru_node, |
369 | "rockchip,grf"); | ||
371 | return ctx->grf; | 370 | return ctx->grf; |
372 | } | 371 | } |
373 | 372 | ||
@@ -427,7 +426,8 @@ void __init rockchip_clk_register_branches( | |||
427 | if (list->div_table) | 426 | if (list->div_table) |
428 | clk = clk_register_divider_table(NULL, | 427 | clk = clk_register_divider_table(NULL, |
429 | list->name, list->parent_names[0], | 428 | list->name, list->parent_names[0], |
430 | flags, ctx->reg_base + list->muxdiv_offset, | 429 | flags, |
430 | ctx->reg_base + list->muxdiv_offset, | ||
431 | list->div_shift, list->div_width, | 431 | list->div_shift, list->div_width, |
432 | list->div_flags, list->div_table, | 432 | list->div_flags, list->div_table, |
433 | &ctx->lock); | 433 | &ctx->lock); |
@@ -441,7 +441,8 @@ void __init rockchip_clk_register_branches( | |||
441 | case branch_fraction_divider: | 441 | case branch_fraction_divider: |
442 | clk = rockchip_clk_register_frac_branch(ctx, list->name, | 442 | clk = rockchip_clk_register_frac_branch(ctx, list->name, |
443 | list->parent_names, list->num_parents, | 443 | list->parent_names, list->num_parents, |
444 | ctx->reg_base, list->muxdiv_offset, list->div_flags, | 444 | ctx->reg_base, list->muxdiv_offset, |
445 | list->div_flags, | ||
445 | list->gate_offset, list->gate_shift, | 446 | list->gate_offset, list->gate_shift, |
446 | list->gate_flags, flags, list->child, | 447 | list->gate_flags, flags, list->child, |
447 | &ctx->lock); | 448 | &ctx->lock); |
@@ -457,7 +458,8 @@ void __init rockchip_clk_register_branches( | |||
457 | case branch_composite: | 458 | case branch_composite: |
458 | clk = rockchip_clk_register_branch(list->name, | 459 | clk = rockchip_clk_register_branch(list->name, |
459 | list->parent_names, list->num_parents, | 460 | list->parent_names, list->num_parents, |
460 | ctx->reg_base, list->muxdiv_offset, list->mux_shift, | 461 | ctx->reg_base, list->muxdiv_offset, |
462 | list->mux_shift, | ||
461 | list->mux_width, list->mux_flags, | 463 | list->mux_width, list->mux_flags, |
462 | list->div_shift, list->div_width, | 464 | list->div_shift, list->div_width, |
463 | list->div_flags, list->div_table, | 465 | list->div_flags, list->div_table, |
@@ -517,8 +519,8 @@ void __init rockchip_clk_register_armclk(struct rockchip_clk_provider *ctx, | |||
517 | struct clk *clk; | 519 | struct clk *clk; |
518 | 520 | ||
519 | clk = rockchip_clk_register_cpuclk(name, parent_names, num_parents, | 521 | clk = rockchip_clk_register_cpuclk(name, parent_names, num_parents, |
520 | reg_data, rates, nrates, ctx->reg_base, | 522 | reg_data, rates, nrates, |
521 | &ctx->lock); | 523 | ctx->reg_base, &ctx->lock); |
522 | if (IS_ERR(clk)) { | 524 | if (IS_ERR(clk)) { |
523 | pr_err("%s: failed to register clock %s: %ld\n", | 525 | pr_err("%s: failed to register clock %s: %ld\n", |
524 | __func__, name, PTR_ERR(clk)); | 526 | __func__, name, PTR_ERR(clk)); |
@@ -560,8 +562,10 @@ static struct notifier_block rockchip_restart_handler = { | |||
560 | .priority = 128, | 562 | .priority = 128, |
561 | }; | 563 | }; |
562 | 564 | ||
563 | void __init rockchip_register_restart_notifier(struct rockchip_clk_provider *ctx, | 565 | void __init |
564 | unsigned int reg, void (*cb)(void)) | 566 | rockchip_register_restart_notifier(struct rockchip_clk_provider *ctx, |
567 | unsigned int reg, | ||
568 | void (*cb)(void)) | ||
565 | { | 569 | { |
566 | int ret; | 570 | int ret; |
567 | 571 | ||
diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h index 4a355bf1d69a..1abb7d05d1c7 100644 --- a/drivers/clk/rockchip/clk.h +++ b/drivers/clk/rockchip/clk.h | |||
@@ -252,7 +252,7 @@ struct rockchip_cpuclk_rate_table { | |||
252 | }; | 252 | }; |
253 | 253 | ||
254 | /** | 254 | /** |
255 | * struct rockchip_cpuclk_reg_data - describes register offsets and masks of the cpuclock | 255 | * struct rockchip_cpuclk_reg_data - register offsets and masks of the cpuclock |
256 | * @core_reg: register offset of the core settings register | 256 | * @core_reg: register offset of the core settings register |
257 | * @div_core_shift: core divider offset used to divide the pll value | 257 | * @div_core_shift: core divider offset used to divide the pll value |
258 | * @div_core_mask: core divider mask | 258 | * @div_core_mask: core divider mask |