goto fail_of_entry;
        }
 
+       if (cell->swnode) {
+               ret = device_add_software_node(&pdev->dev, cell->swnode);
+               if (ret)
+                       goto fail_of_entry;
+       }
+
        for (r = 0; r < cell->num_resources; r++) {
                res[r].name = cell->resources[r].name;
                res[r].flags = cell->resources[r].flags;
                        list_del(&of_entry->list);
                        kfree(of_entry);
                }
+       device_remove_software_node(&pdev->dev);
 fail_alias:
        regulator_bulk_unregister_supply_alias(&pdev->dev,
                                               cell->parent_supplies,
        regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies,
                                               cell->num_parent_supplies);
 
+       device_remove_software_node(&pdev->dev);
+
        platform_device_unregister(pdev);
        return 0;
 }
 
 #define MFD_DEP_LEVEL_HIGH 1
 
 struct irq_domain;
+struct software_node;
 struct property_entry;
 
 /* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */
        void                    *platform_data;
        size_t                  pdata_size;
 
+       /* Software node for the device. */
+       const struct software_node *swnode;
+
        /* device properties passed to the sub devices drivers */
        const struct property_entry *properties;