Skip to content

Commit 2a6a8e2

Browse files
shcgitKAGA-KOKO
authored andcommitted
clocksource/drivers/clps711x: Remove board support
Since board support for the CLPS711X platform was removed, remove the board support from the clps711x-timer driver. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lkml.kernel.org/r/20181220111626.17140-1-shc_work@mail.ru
1 parent 32d0be0 commit 2a6a8e2

File tree

1 file changed

+13
-32
lines changed

1 file changed

+13
-32
lines changed

drivers/clocksource/clps711x-timer.c

Lines changed: 13 additions & 32 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,32 +77,29 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
9377
"clps711x-timer", clkevt);
9478
}
9579

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

86+
if (!base)
87+
return -ENOMEM;
88+
if (!irq)
89+
return -EINVAL;
90+
if (IS_ERR(clock))
91+
return PTR_ERR(clock);
92+
11493
switch (of_alias_get_id(np, "timer")) {
11594
case CLPS711X_CLKSRC_CLOCKSOURCE:
116-
return _clps711x_clksrc_init(clock, base);
95+
clps711x_clksrc_init(clock, base);
96+
break;
11797
case CLPS711X_CLKSRC_CLOCKEVENT:
11898
return _clps711x_clkevt_init(clock, base, irq);
11999
default:
120100
return -EINVAL;
121101
}
102+
103+
return 0;
122104
}
123105
TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
124-
#endif

0 commit comments

Comments
 (0)