diff options
Diffstat (limited to 'drivers/clocksource/bcm2835.c')
-rw-r--r-- | drivers/clocksource/bcm2835.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/clocksource/bcm2835.c b/drivers/clocksource/bcm2835.c index 179109aee2..73f4e8f411 100644 --- a/drivers/clocksource/bcm2835.c +++ b/drivers/clocksource/bcm2835.c @@ -1,18 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Author: Carlo Caione <carlo@carlocaione.org> * * Based on clocksource for nomadik - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ @@ -38,9 +28,11 @@ static uint64_t stc_read_cycles(void) static struct clocksource bcm2835_stc = { .read = stc_read_cycles, .mask = CLOCKSOURCE_MASK(32), + /* Give the architected timer precedence on AArch64 */ + .priority = IS_ENABLED(CONFIG_CPU_V8) ? 60 : 80, }; -static int bcm2835_cs_probe(struct device_d *dev) +static int bcm2835_cs_probe(struct device *dev) { struct resource *iores; static struct clk *stc_clk; @@ -49,7 +41,7 @@ static int bcm2835_cs_probe(struct device_d *dev) /* try to read rate from DT property first */ if (IS_ENABLED(CONFIG_OFTREE)) - of_property_read_u32(dev->device_node, "clock-frequency", + of_property_read_u32(dev->of_node, "clock-frequency", &rate); /* if rate is still empty, try to get rate from clk */ @@ -88,8 +80,9 @@ static __maybe_unused struct of_device_id bcm2835_cs_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, bcm2835_cs_dt_ids); -static struct driver_d bcm2835_cs_driver = { +static struct driver bcm2835_cs_driver = { .name = "bcm2835-cs", .probe = bcm2835_cs_probe, .of_compatible = DRV_OF_COMPAT(bcm2835_cs_dt_ids), |