diff options
Diffstat (limited to 'drivers/clocksource/clps711x.c')
-rw-r--r-- | drivers/clocksource/clps711x.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/clocksource/clps711x.c b/drivers/clocksource/clps711x.c index a99147f30c..f8bdc06ea8 100644 --- a/drivers/clocksource/clps711x.c +++ b/drivers/clocksource/clps711x.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +// SPDX-License-Identifier: GPL-2.0-or-later /* Author: Alexander Shiyan <shc_work@mail.ru> */ #include <common.h> @@ -19,13 +19,19 @@ static uint64_t clps711x_cs_read(void) static struct clocksource clps711x_cs = { .read = clps711x_cs_read, .mask = CLOCKSOURCE_MASK(16), + .priority = 60, }; -static int clps711x_cs_probe(struct device_d *dev) +static int clps711x_cs_probe(struct device *dev) { struct resource *iores; u32 rate; struct clk *timer_clk; + int id; + + id = of_alias_get_id(dev->of_node, "timer"); + if (id != 1) + return 0; timer_clk = clk_get(dev, NULL); if (IS_ERR(timer_clk)) @@ -45,12 +51,13 @@ static int clps711x_cs_probe(struct device_d *dev) return init_clock(&clps711x_cs); } -static __maybe_unused struct of_device_id clps711x_timer_dt_ids[] = { +static const struct of_device_id __maybe_unused clps711x_timer_dt_ids[] = { { .compatible = "cirrus,ep7209-timer", }, { } }; +MODULE_DEVICE_TABLE(of, clps711x_timer_dt_ids); -static struct driver_d clps711x_cs_driver = { +static struct driver clps711x_cs_driver = { .name = "clps711x-cs", .probe = clps711x_cs_probe, .of_compatible = DRV_OF_COMPAT(clps711x_timer_dt_ids), |