struct divs_data {
        const struct factors_data *factors; /* data for the factor clock */
+       int ndivs; /* number of children */
        struct {
                u8 fixed; /* is it a fixed divisor? if not... */
                struct clk_div_table *table; /* is it a table based divisor? */
 
 static const struct divs_data pll5_divs_data __initconst = {
        .factors = &sun4i_pll5_data,
+       .ndivs = 2,
        .div = {
                { .shift = 0, .pow = 0, }, /* M, DDR */
                { .shift = 16, .pow = 1, }, /* P, other */
 
 static const struct divs_data pll6_divs_data __initconst = {
        .factors = &sun4i_pll6_data,
+       .ndivs = 2,
        .div = {
                { .shift = 0, .table = pll6_sata_tbl, .gate = 14 }, /* M, SATA */
                { .fixed = 2 }, /* P, other */
        struct clk_fixed_factor *fix_factor;
        struct clk_divider *divider;
        void __iomem *reg;
-       int i = 0;
+       int ndivs = SUNXI_DIVS_MAX_QTY, i = 0;
        int flags, clkflags;
 
        /* Set up factor clock that we will be dividing */
         * our RAM clock! */
        clkflags = !strcmp("pll5", parent) ? 0 : CLK_SET_RATE_PARENT;
 
-       for (i = 0; i < SUNXI_DIVS_MAX_QTY; i++) {
+       /* if number of children known, use it */
+       if (data->ndivs)
+               ndivs = data->ndivs;
+
+       for (i = 0; i < ndivs; i++) {
                if (of_property_read_string_index(node, "clock-output-names",
                                                  i, &clk_name) != 0)
                        break;