diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2016-03-01 13:51:42 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@baylibre.com> | 2016-03-01 19:21:25 -0500 |
commit | 8a8b6eb7a87f12804f44128d6e4c59b19f224308 (patch) | |
tree | 34f5b3370d236fc28bb6c14228fb91839ecaaa12 | |
parent | c2ee9bdc852dcd1f2f3a6adaa986f14441a673f3 (diff) |
clk: ti: Fix some errors found by static checkers
drivers/clk/ti/clk-814x.c:34:12: warning: symbol 'dm814x_adpll_early_init' was not declared. Should it be static?
drivers/clk/ti/clk-814x.c:58:12: warning: symbol 'dm814x_adpll_enable_init_clocks' was not declared. Should it be static?
drivers/clk/ti/adpll.c:465 ti_adpll_recalc_rate() warn: should '__readw(d->regs + 20) << 18' be a 64 bit type?
drivers/clk/ti/adpll.c:945 ti_adpll_probe() error: we previously assumed 'd->clocks' could be null (see line 921)
The last one looks like a real bug because we don't return an
error on allocation failure.
Cc: Tero Kristo <t-kristo@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/ti/adpll.c | 4 | ||||
-rw-r--r-- | drivers/clk/ti/clk-814x.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/clk/ti/adpll.c b/drivers/clk/ti/adpll.c index f741d79e5afd..255cafb18336 100644 --- a/drivers/clk/ti/adpll.c +++ b/drivers/clk/ti/adpll.c | |||
@@ -462,7 +462,7 @@ static unsigned long ti_adpll_recalc_rate(struct clk_hw *hw, | |||
462 | spin_lock_irqsave(&d->lock, flags); | 462 | spin_lock_irqsave(&d->lock, flags); |
463 | frac_m = readl_relaxed(d->regs + ADPLL_FRACDIV_OFFSET); | 463 | frac_m = readl_relaxed(d->regs + ADPLL_FRACDIV_OFFSET); |
464 | frac_m &= ADPLL_FRACDIV_FRACTIONALM_MASK; | 464 | frac_m &= ADPLL_FRACDIV_FRACTIONALM_MASK; |
465 | rate = readw_relaxed(d->regs + ADPLL_MN2DIV_OFFSET) << 18; | 465 | rate = (u64)readw_relaxed(d->regs + ADPLL_MN2DIV_OFFSET) << 18; |
466 | rate += frac_m; | 466 | rate += frac_m; |
467 | rate *= parent_rate; | 467 | rate *= parent_rate; |
468 | divider = (readw_relaxed(d->regs + ADPLL_M2NDIV_OFFSET) + 1) << 18; | 468 | divider = (readw_relaxed(d->regs + ADPLL_M2NDIV_OFFSET) + 1) << 18; |
@@ -919,7 +919,7 @@ static int ti_adpll_probe(struct platform_device *pdev) | |||
919 | TI_ADPLL_NR_CLOCKS, | 919 | TI_ADPLL_NR_CLOCKS, |
920 | GFP_KERNEL); | 920 | GFP_KERNEL); |
921 | if (!d->clocks) | 921 | if (!d->clocks) |
922 | goto free; | 922 | return -ENOMEM; |
923 | 923 | ||
924 | err = ti_adpll_init_dco(d); | 924 | err = ti_adpll_init_dco(d); |
925 | if (err) { | 925 | if (err) { |
diff --git a/drivers/clk/ti/clk-814x.c b/drivers/clk/ti/clk-814x.c index 2323643fb731..52c6efc53731 100644 --- a/drivers/clk/ti/clk-814x.c +++ b/drivers/clk/ti/clk-814x.c | |||
@@ -31,7 +31,7 @@ static struct ti_dt_clk dm814_clks[] = { | |||
31 | 31 | ||
32 | static bool timer_clocks_initialized; | 32 | static bool timer_clocks_initialized; |
33 | 33 | ||
34 | int __init dm814x_adpll_early_init(void) | 34 | static int __init dm814x_adpll_early_init(void) |
35 | { | 35 | { |
36 | struct device_node *np; | 36 | struct device_node *np; |
37 | 37 | ||
@@ -55,7 +55,7 @@ static const char * const init_clocks[] = { | |||
55 | "pll290clkout", /* DDR 481c5290.adpll.clkout */ | 55 | "pll290clkout", /* DDR 481c5290.adpll.clkout */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | int __init dm814x_adpll_enable_init_clocks(void) | 58 | static int __init dm814x_adpll_enable_init_clocks(void) |
59 | { | 59 | { |
60 | int i, err; | 60 | int i, err; |
61 | 61 | ||