Skip to content

Commit a75eda7

Browse files
committed
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: "A set of small fixes plus the removal of stale board support code: - Remove the board support code from the clpx711x clocksource driver. This change had fallen through the cracks and I'm sending it now rather than dealing with people who want to improve that stale code for 3 month. - Use the proper clocksource mask on RICSV - Make local scope functions and variables static" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/clps711x: Remove board support clocksource/drivers/riscv: Fix clocksource mask clocksource/drivers/mips-gic-timer: Make gic_compare_irqaction static clocksource/drivers/timer-ti-dm: Make omap_dm_timer_set_load_start() static clocksource/drivers/tcb_clksrc: Make tc_clksrc_suspend/resume() static clocksource/drivers/clps711x: Make clps711x_clksrc_init() static time/jiffies: Make refined_jiffies static
2 parents f6cc519 + 2a6a8e2 commit a75eda7

File tree

6 files changed

+21
-40
lines changed

6 files changed

+21
-40
lines changed

drivers/clocksource/clps711x-timer.c

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,16 @@ static u64 notrace clps711x_sched_clock_read(void)
3131
return ~readw(tcd);
3232
}
3333

34-
static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base)
34+
static void __init clps711x_clksrc_init(struct clk *clock, void __iomem *base)
3535
{
36-
unsigned long rate;
37-
38-
if (!base)
39-
return -ENOMEM;
40-
if (IS_ERR(clock))
41-
return PTR_ERR(clock);
42-
43-
rate = clk_get_rate(clock);
36+
unsigned long rate = clk_get_rate(clock);
4437

4538
tcd = base;
4639

4740
clocksource_mmio_init(tcd, "clps711x-clocksource", rate, 300, 16,
4841
clocksource_mmio_readw_down);
4942

5043
sched_clock_register(clps711x_sched_clock_read, 16, rate);
51-
52-
return 0;
5344
}
5445

5546
static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id)
@@ -67,13 +58,6 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
6758
struct clock_event_device *clkevt;
6859
unsigned long rate;
6960

70-
if (!irq)
71-
return -EINVAL;
72-
if (!base)
73-
return -ENOMEM;
74-
if (IS_ERR(clock))
75-
return PTR_ERR(clock);
76-
7761
clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL);
7862
if (!clkevt)
7963
return -ENOMEM;
@@ -93,31 +77,29 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
9377
"clps711x-timer", clkevt);
9478
}
9579

96-
void __init clps711x_clksrc_init(void __iomem *tc1_base, void __iomem *tc2_base,
97-
unsigned int irq)
98-
{
99-
struct clk *tc1 = clk_get_sys("clps711x-timer.0", NULL);
100-
struct clk *tc2 = clk_get_sys("clps711x-timer.1", NULL);
101-
102-
BUG_ON(_clps711x_clksrc_init(tc1, tc1_base));
103-
BUG_ON(_clps711x_clkevt_init(tc2, tc2_base, irq));
104-
}
105-
106-
#ifdef CONFIG_TIMER_OF
10780
static int __init clps711x_timer_init(struct device_node *np)
10881
{
10982
unsigned int irq = irq_of_parse_and_map(np, 0);
11083
struct clk *clock = of_clk_get(np, 0);
11184
void __iomem *base = of_iomap(np, 0);
11285

86+
if (!base)
87+
return -ENOMEM;
88+
if (!irq)
89+
return -EINVAL;
90+
if (IS_ERR(clock))
91+
return PTR_ERR(clock);
92+
11393
switch (of_alias_get_id(np, "timer")) {
11494
case CLPS711X_CLKSRC_CLOCKSOURCE:
115-
return _clps711x_clksrc_init(clock, base);
95+
clps711x_clksrc_init(clock, base);
96+
break;
11697
case CLPS711X_CLKSRC_CLOCKEVENT:
11798
return _clps711x_clkevt_init(clock, base, irq);
11899
default:
119100
return -EINVAL;
120101
}
102+
103+
return 0;
121104
}
122105
TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
123-
#endif

drivers/clocksource/mips-gic-timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
6767
return IRQ_HANDLED;
6868
}
6969

70-
struct irqaction gic_compare_irqaction = {
70+
static struct irqaction gic_compare_irqaction = {
7171
.handler = gic_compare_interrupt,
7272
.percpu_dev_id = &gic_clockevent_device,
7373
.flags = IRQF_PERCPU | IRQF_TIMER,

drivers/clocksource/tcb_clksrc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static u64 tc_get_cycles32(struct clocksource *cs)
7171
return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV));
7272
}
7373

74-
void tc_clksrc_suspend(struct clocksource *cs)
74+
static void tc_clksrc_suspend(struct clocksource *cs)
7575
{
7676
int i;
7777

@@ -86,7 +86,7 @@ void tc_clksrc_suspend(struct clocksource *cs)
8686
bmr_cache = readl(tcaddr + ATMEL_TC_BMR);
8787
}
8888

89-
void tc_clksrc_resume(struct clocksource *cs)
89+
static void tc_clksrc_resume(struct clocksource *cs)
9090
{
9191
int i;
9292

drivers/clocksource/timer-riscv.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static u64 riscv_sched_clock(void)
5858
static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {
5959
.name = "riscv_clocksource",
6060
.rating = 300,
61-
.mask = CLOCKSOURCE_MASK(BITS_PER_LONG),
61+
.mask = CLOCKSOURCE_MASK(64),
6262
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
6363
.read = riscv_clocksource_rdtime,
6464
};
@@ -120,8 +120,7 @@ static int __init riscv_timer_init_dt(struct device_node *n)
120120
return error;
121121
}
122122

123-
sched_clock_register(riscv_sched_clock,
124-
BITS_PER_LONG, riscv_timebase);
123+
sched_clock_register(riscv_sched_clock, 64, riscv_timebase);
125124

126125
error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING,
127126
"clockevents/riscv/timer:starting",

drivers/clocksource/timer-ti-dm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ static int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
586586
}
587587

588588
/* Optimized set_load which removes costly spin wait in timer_start */
589-
int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
590-
unsigned int load)
589+
static int omap_dm_timer_set_load_start(struct omap_dm_timer *timer,
590+
int autoreload, unsigned int load)
591591
{
592592
u32 l;
593593

kernel/time/jiffies.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct clocksource * __init __weak clocksource_default_clock(void)
8989
return &clocksource_jiffies;
9090
}
9191

92-
struct clocksource refined_jiffies;
92+
static struct clocksource refined_jiffies;
9393

9494
int register_refined_jiffies(long cycles_per_second)
9595
{

0 commit comments

Comments
 (0)