{
        int ret, i;
 
-       if (WARN(pfdev->comp->num_supplies > ARRAY_SIZE(pfdev->regulators),
-                       "Too many supplies in compatible structure.\n"))
-               return -EINVAL;
+       pfdev->regulators = devm_kcalloc(pfdev->dev, pfdev->comp->num_supplies,
+                                        sizeof(*pfdev->regulators),
+                                        GFP_KERNEL);
+       if (!pfdev->regulators)
+               return -ENOMEM;
 
        for (i = 0; i < pfdev->comp->num_supplies; i++)
                pfdev->regulators[i].supply = pfdev->comp->supply_names[i];
 
 static void panfrost_regulator_fini(struct panfrost_device *pfdev)
 {
-       regulator_bulk_disable(pfdev->comp->num_supplies,
-                       pfdev->regulators);
+       if (!pfdev->regulators)
+               return;
+
+       regulator_bulk_disable(pfdev->comp->num_supplies, pfdev->regulators);
 }
 
 static void panfrost_pm_domain_fini(struct panfrost_device *pfdev)
 
 struct panfrost_perfcnt;
 
 #define NUM_JOB_SLOTS 3
-#define MAX_REGULATORS 2
 #define MAX_PM_DOMAINS 3
 
 struct panfrost_features {
        void __iomem *iomem;
        struct clk *clock;
        struct clk *bus_clock;
-       struct regulator_bulk_data regulators[MAX_REGULATORS];
+       struct regulator_bulk_data *regulators;
        struct reset_control *rstc;
        /* pm_domains for devices with more than one. */
        struct device *pm_domain_devs[MAX_PM_DOMAINS];