提交 42e59982 编写于 作者: H Heikki Krogerus 提交者: Lee Jones

mfd: core: Add support for software nodes

The old device property API is going to be removed and
replaced with the newer software node API. This prepares MFD
subsystem for the transition.
Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 586478bf
...@@ -244,6 +244,12 @@ static int mfd_add_device(struct device *parent, int id, ...@@ -244,6 +244,12 @@ static int mfd_add_device(struct device *parent, int id,
goto fail_of_entry; 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++) { for (r = 0; r < cell->num_resources; r++) {
res[r].name = cell->resources[r].name; res[r].name = cell->resources[r].name;
res[r].flags = cell->resources[r].flags; res[r].flags = cell->resources[r].flags;
...@@ -304,6 +310,7 @@ static int mfd_add_device(struct device *parent, int id, ...@@ -304,6 +310,7 @@ static int mfd_add_device(struct device *parent, int id,
list_del(&of_entry->list); list_del(&of_entry->list);
kfree(of_entry); kfree(of_entry);
} }
device_remove_software_node(&pdev->dev);
fail_alias: fail_alias:
regulator_bulk_unregister_supply_alias(&pdev->dev, regulator_bulk_unregister_supply_alias(&pdev->dev,
cell->parent_supplies, cell->parent_supplies,
...@@ -372,6 +379,8 @@ static int mfd_remove_devices_fn(struct device *dev, void *data) ...@@ -372,6 +379,8 @@ static int mfd_remove_devices_fn(struct device *dev, void *data)
regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies, regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies,
cell->num_parent_supplies); cell->num_parent_supplies);
device_remove_software_node(&pdev->dev);
platform_device_unregister(pdev); platform_device_unregister(pdev);
return 0; return 0;
} }
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#define MFD_DEP_LEVEL_HIGH 1 #define MFD_DEP_LEVEL_HIGH 1
struct irq_domain; struct irq_domain;
struct software_node;
struct property_entry; struct property_entry;
/* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */ /* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */
...@@ -78,6 +79,9 @@ struct mfd_cell { ...@@ -78,6 +79,9 @@ struct mfd_cell {
void *platform_data; void *platform_data;
size_t pdata_size; size_t pdata_size;
/* Software node for the device. */
const struct software_node *swnode;
/* device properties passed to the sub devices drivers */ /* device properties passed to the sub devices drivers */
const struct property_entry *properties; const struct property_entry *properties;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册