X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fclk%2Fclk-prima2.c;h=6c15e3316137b87177753f3bd2b04d154d2f3f7a;hb=e086df92e21ac83e6a45933a205b62ad79097db5;hp=5ab95f1ad579288c516dc782b14a2b5a871ad7dc;hpb=fa1586a7e43760f0e25e72b2e3f97ee18b2be967;p=~andy%2Flinux diff --git a/drivers/clk/clk-prima2.c b/drivers/clk/clk-prima2.c index 5ab95f1ad57..6c15e331613 100644 --- a/drivers/clk/clk-prima2.c +++ b/drivers/clk/clk-prima2.c @@ -1015,16 +1015,6 @@ static struct clk_std clk_usb1 = { }, }; -static struct of_device_id clkc_ids[] = { - { .compatible = "sirf,prima2-clkc" }, - {}, -}; - -static struct of_device_id rsc_ids[] = { - { .compatible = "sirf,prima2-rsc" }, - {}, -}; - enum prima2_clk_index { /* 0 1 2 3 4 5 6 7 8 9 */ rtc, osc, pll1, pll2, pll3, mem, sys, security, dsp, gps, @@ -1082,24 +1072,16 @@ static struct clk_hw *prima2_clk_hw_array[maxclk] __initdata = { static struct clk *prima2_clks[maxclk]; static struct clk_onecell_data clk_data; -void __init sirfsoc_of_clk_init(void) +static void __init sirfsoc_clk_init(struct device_node *np) { - struct device_node *np; + struct device_node *rscnp; int i; - np = of_find_matching_node(NULL, rsc_ids); - if (!np) - panic("unable to find compatible rsc node in dtb\n"); - - sirfsoc_rsc_vbase = of_iomap(np, 0); + rscnp = of_find_compatible_node(NULL, NULL, "sirf,prima2-rsc"); + sirfsoc_rsc_vbase = of_iomap(rscnp, 0); if (!sirfsoc_rsc_vbase) panic("unable to map rsc registers\n"); - - of_node_put(np); - - np = of_find_matching_node(NULL, clkc_ids); - if (!np) - return; + of_node_put(rscnp); sirfsoc_clk_vbase = of_iomap(np, 0); if (!sirfsoc_clk_vbase) @@ -1124,3 +1106,4 @@ void __init sirfsoc_of_clk_init(void) of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); } +CLK_OF_DECLARE(sirfsoc_clk, "sirf,prima2-clkc", sirfsoc_clk_init);