aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2022-03-31 15:54:49 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-04-05 15:30:47 +0200
commit68b979d068d3d0dceb14c446f664433d96f20a7e (patch)
treee4d79df7a341cd7e2bae877b3c70084d40979d25 /drivers/of
parentACPI: property: Move acpi_fwnode_device_get_match_data() up (diff)
downloadlinux-dev-68b979d068d3d0dceb14c446f664433d96f20a7e.tar.xz
linux-dev-68b979d068d3d0dceb14c446f664433d96f20a7e.zip
device property: Add iomap to fwnode operations
Add iomap() fwnode operation to implement fwnode_iomap() through fwnode operations, moving the code in fwnode_iomap() to OF framework. Note that the IS_ENABLED(CONFIG_OF_ADDRESS) && is_of_node(fwnode) check is needed for Sparc that has its own implementation of of_iomap anyway. Let the pre-compiler to handle that check. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/property.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 676899566f7c..ac2aa5221069 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1465,6 +1465,15 @@ static int of_link_property(struct device_node *con_np, const char *prop_name)
return 0;
}
+static void __iomem *of_fwnode_iomap(struct fwnode_handle *fwnode, int index)
+{
+#ifdef CONFIG_OF_ADDRESS
+ return of_iomap(to_of_node(fwnode), index);
+#else
+ return NULL;
+#endif
+}
+
static int of_fwnode_add_links(struct fwnode_handle *fwnode)
{
struct property *p;
@@ -1502,6 +1511,7 @@ const struct fwnode_operations of_fwnode_ops = {
.graph_get_remote_endpoint = of_fwnode_graph_get_remote_endpoint,
.graph_get_port_parent = of_fwnode_graph_get_port_parent,
.graph_parse_endpoint = of_fwnode_graph_parse_endpoint,
+ .iomap = of_fwnode_iomap,
.add_links = of_fwnode_add_links,
};
EXPORT_SYMBOL_GPL(of_fwnode_ops);