Skip to content

Commit 428d97e

Browse files
ambarusbebarino
authored andcommitted
clk: at91: Fix the declaration of the clocks
These are all "early clocks" that require initialization just at of_clk_init() time. Use CLK_OF_DECLARE() to declare them. This also fixes a problem that was spotted when fw_devlink was set to 'on' by default: the boards failed to boot. The reason is that CLK_OF_DECLARE_DRIVER() clears the OF_POPULATED and causes the consumers of the clock to be postponed by fw_devlink until the second initialization routine of the clock has been completed. One of the consumers of the clock is the timer, which is used as a clocksource, and needs the clock initialized early. Postponing the timers caused the fail at boot. Signed-off-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Saravana Kannan <[email protected]> Tested-by: Eugen Hristev <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Reviewed-by: Claudiu Beznea <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 5c8fe58 commit 428d97e

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

drivers/clk/at91/at91rm9200.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,5 +215,4 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
215215
* deferring properly. Once this is fixed, this can be switched to a platform
216216
* driver.
217217
*/
218-
CLK_OF_DECLARE_DRIVER(at91rm9200_pmc, "atmel,at91rm9200-pmc",
219-
at91rm9200_pmc_setup);
218+
CLK_OF_DECLARE(at91rm9200_pmc, "atmel,at91rm9200-pmc", at91rm9200_pmc_setup);

drivers/clk/at91/at91sam9260.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -491,26 +491,26 @@ static void __init at91sam9260_pmc_setup(struct device_node *np)
491491
{
492492
at91sam926x_pmc_setup(np, &at91sam9260_data);
493493
}
494-
CLK_OF_DECLARE_DRIVER(at91sam9260_pmc, "atmel,at91sam9260-pmc",
495-
at91sam9260_pmc_setup);
494+
495+
CLK_OF_DECLARE(at91sam9260_pmc, "atmel,at91sam9260-pmc", at91sam9260_pmc_setup);
496496

497497
static void __init at91sam9261_pmc_setup(struct device_node *np)
498498
{
499499
at91sam926x_pmc_setup(np, &at91sam9261_data);
500500
}
501-
CLK_OF_DECLARE_DRIVER(at91sam9261_pmc, "atmel,at91sam9261-pmc",
502-
at91sam9261_pmc_setup);
501+
502+
CLK_OF_DECLARE(at91sam9261_pmc, "atmel,at91sam9261-pmc", at91sam9261_pmc_setup);
503503

504504
static void __init at91sam9263_pmc_setup(struct device_node *np)
505505
{
506506
at91sam926x_pmc_setup(np, &at91sam9263_data);
507507
}
508-
CLK_OF_DECLARE_DRIVER(at91sam9263_pmc, "atmel,at91sam9263-pmc",
509-
at91sam9263_pmc_setup);
508+
509+
CLK_OF_DECLARE(at91sam9263_pmc, "atmel,at91sam9263-pmc", at91sam9263_pmc_setup);
510510

511511
static void __init at91sam9g20_pmc_setup(struct device_node *np)
512512
{
513513
at91sam926x_pmc_setup(np, &at91sam9g20_data);
514514
}
515-
CLK_OF_DECLARE_DRIVER(at91sam9g20_pmc, "atmel,at91sam9g20-pmc",
516-
at91sam9g20_pmc_setup);
515+
516+
CLK_OF_DECLARE(at91sam9g20_pmc, "atmel,at91sam9g20-pmc", at91sam9g20_pmc_setup);

drivers/clk/at91/at91sam9g45.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,4 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
228228
* The TCB is used as the clocksource so its clock is needed early. This means
229229
* this can't be a platform driver.
230230
*/
231-
CLK_OF_DECLARE_DRIVER(at91sam9g45_pmc, "atmel,at91sam9g45-pmc",
232-
at91sam9g45_pmc_setup);
231+
CLK_OF_DECLARE(at91sam9g45_pmc, "atmel,at91sam9g45-pmc", at91sam9g45_pmc_setup);

drivers/clk/at91/at91sam9n12.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,4 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
255255
* The TCB is used as the clocksource so its clock is needed early. This means
256256
* this can't be a platform driver.
257257
*/
258-
CLK_OF_DECLARE_DRIVER(at91sam9n12_pmc, "atmel,at91sam9n12-pmc",
259-
at91sam9n12_pmc_setup);
258+
CLK_OF_DECLARE(at91sam9n12_pmc, "atmel,at91sam9n12-pmc", at91sam9n12_pmc_setup);

drivers/clk/at91/at91sam9rl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,5 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
186186
err_free:
187187
kfree(at91sam9rl_pmc);
188188
}
189-
CLK_OF_DECLARE_DRIVER(at91sam9rl_pmc, "atmel,at91sam9rl-pmc", at91sam9rl_pmc_setup);
189+
190+
CLK_OF_DECLARE(at91sam9rl_pmc, "atmel,at91sam9rl-pmc", at91sam9rl_pmc_setup);

drivers/clk/at91/at91sam9x5.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,33 +302,33 @@ static void __init at91sam9g15_pmc_setup(struct device_node *np)
302302
{
303303
at91sam9x5_pmc_setup(np, at91sam9g15_periphck, true);
304304
}
305-
CLK_OF_DECLARE_DRIVER(at91sam9g15_pmc, "atmel,at91sam9g15-pmc",
306-
at91sam9g15_pmc_setup);
305+
306+
CLK_OF_DECLARE(at91sam9g15_pmc, "atmel,at91sam9g15-pmc", at91sam9g15_pmc_setup);
307307

308308
static void __init at91sam9g25_pmc_setup(struct device_node *np)
309309
{
310310
at91sam9x5_pmc_setup(np, at91sam9g25_periphck, false);
311311
}
312-
CLK_OF_DECLARE_DRIVER(at91sam9g25_pmc, "atmel,at91sam9g25-pmc",
313-
at91sam9g25_pmc_setup);
312+
313+
CLK_OF_DECLARE(at91sam9g25_pmc, "atmel,at91sam9g25-pmc", at91sam9g25_pmc_setup);
314314

315315
static void __init at91sam9g35_pmc_setup(struct device_node *np)
316316
{
317317
at91sam9x5_pmc_setup(np, at91sam9g35_periphck, true);
318318
}
319-
CLK_OF_DECLARE_DRIVER(at91sam9g35_pmc, "atmel,at91sam9g35-pmc",
320-
at91sam9g35_pmc_setup);
319+
320+
CLK_OF_DECLARE(at91sam9g35_pmc, "atmel,at91sam9g35-pmc", at91sam9g35_pmc_setup);
321321

322322
static void __init at91sam9x25_pmc_setup(struct device_node *np)
323323
{
324324
at91sam9x5_pmc_setup(np, at91sam9x25_periphck, false);
325325
}
326-
CLK_OF_DECLARE_DRIVER(at91sam9x25_pmc, "atmel,at91sam9x25-pmc",
327-
at91sam9x25_pmc_setup);
326+
327+
CLK_OF_DECLARE(at91sam9x25_pmc, "atmel,at91sam9x25-pmc", at91sam9x25_pmc_setup);
328328

329329
static void __init at91sam9x35_pmc_setup(struct device_node *np)
330330
{
331331
at91sam9x5_pmc_setup(np, at91sam9x35_periphck, true);
332332
}
333-
CLK_OF_DECLARE_DRIVER(at91sam9x35_pmc, "atmel,at91sam9x35-pmc",
334-
at91sam9x35_pmc_setup);
333+
334+
CLK_OF_DECLARE(at91sam9x35_pmc, "atmel,at91sam9x35-pmc", at91sam9x35_pmc_setup);

drivers/clk/at91/sama5d2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,5 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
372372
err_free:
373373
kfree(sama5d2_pmc);
374374
}
375-
CLK_OF_DECLARE_DRIVER(sama5d2_pmc, "atmel,sama5d2-pmc", sama5d2_pmc_setup);
375+
376+
CLK_OF_DECLARE(sama5d2_pmc, "atmel,sama5d2-pmc", sama5d2_pmc_setup);

drivers/clk/at91/sama5d3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,4 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
255255
* The TCB is used as the clocksource so its clock is needed early. This means
256256
* this can't be a platform driver.
257257
*/
258-
CLK_OF_DECLARE_DRIVER(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);
258+
CLK_OF_DECLARE(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);

drivers/clk/at91/sama5d4.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,5 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
286286
err_free:
287287
kfree(sama5d4_pmc);
288288
}
289-
CLK_OF_DECLARE_DRIVER(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);
289+
290+
CLK_OF_DECLARE(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);

0 commit comments

Comments
 (0)