Skip to content

Commit 612f860

Browse files
msperlpopcornmix
authored andcommitted
Register the clocks early during the boot process,
so that special/critical clocks can get enabled early on in the boot process avoiding the risk of disabling a clock, pll_divider or pll when a claiming driver fails to install propperly - maybe it needs to defer. Signed-off-by: Martin Sperl <[email protected]>
1 parent 9e4e001 commit 612f860

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

drivers/clk/bcm/clk-bcm2835.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,8 +1891,15 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
18911891
if (ret)
18921892
return ret;
18931893

1894-
return of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
1895-
&cprman->onecell);
1894+
ret = of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
1895+
&cprman->onecell);
1896+
if (ret)
1897+
return ret;
1898+
1899+
/* note that we have registered all the clocks */
1900+
dev_dbg(dev, "registered %d clocks\n", asize);
1901+
1902+
return 0;
18961903
}
18971904

18981905
static const struct of_device_id bcm2835_clk_of_match[] = {
@@ -1909,7 +1916,11 @@ static struct platform_driver bcm2835_clk_driver = {
19091916
.probe = bcm2835_clk_probe,
19101917
};
19111918

1912-
builtin_platform_driver(bcm2835_clk_driver);
1919+
static int __init __bcm2835_clk_driver_init(void)
1920+
{
1921+
return platform_driver_register(&bcm2835_clk_driver);
1922+
}
1923+
core_initcall(__bcm2835_clk_driver_init);
19131924

19141925
MODULE_AUTHOR("Eric Anholt <[email protected]>");
19151926
MODULE_DESCRIPTION("BCM2835 clock driver");

0 commit comments

Comments
 (0)