From: Rob Herring <robh@kernel.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-acpi@vger.kernel.org, andriy.shevchenko@linux.intel.com,
devicetree@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Frank Rowand <frowand.list@gmail.com>
Subject: Re: [PATCH 3/4] device property: Add iomap to fwnode operations
Date: Fri, 11 Feb 2022 09:59:42 -0600 [thread overview]
Message-ID: <YgaH7iJ5CWSJp1PY@robh.at.kernel.org> (raw)
In-Reply-To: <20220206091643.276833-4-sakari.ailus@linux.intel.com>
On Sun, Feb 06, 2022 at 11:16:42AM +0200, Sakari Ailus wrote:
> Add iomap() fwnode operation to implement fwnode_iomap() through fwnode
> operations, moving the code in fwnode_iomap() to OF framework.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> drivers/base/property.c | 5 +----
> drivers/of/property.c | 7 +++++++
> include/linux/fwnode.h | 1 +
> 3 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index 09686e2e903e..83dd22e7cb81 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -887,10 +887,7 @@ EXPORT_SYMBOL_GPL(device_get_phy_mode);
> */
> void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index)
> {
> - if (IS_ENABLED(CONFIG_OF_ADDRESS) && is_of_node(fwnode))
> - return of_iomap(to_of_node(fwnode), index);
> -
> - return NULL;
> + return fwnode_call_ptr_op(fwnode, iomap, index);
> }
> EXPORT_SYMBOL(fwnode_iomap);
>
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 676899566f7c..8beb89709740 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -1465,6 +1465,12 @@ 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)
> +{
> + return IS_ENABLED(CONFIG_OF_ADDRESS) ?
I think this shouldn't be needed. !OF_ADDRESS is Sparc which just has
its own implementation of of_iomap().
> + of_iomap(to_of_node(fwnode), index) : NULL;
> +}
> +
> static int of_fwnode_add_links(struct fwnode_handle *fwnode)
> {
> struct property *p;
> @@ -1502,6 +1508,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);
> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
> index 6f307f21fc65..ebbc3bf03f95 100644
> --- a/include/linux/fwnode.h
> +++ b/include/linux/fwnode.h
> @@ -148,6 +148,7 @@ struct fwnode_operations {
> (*graph_get_port_parent)(struct fwnode_handle *fwnode);
> int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode,
> struct fwnode_endpoint *endpoint);
> + void __iomem *(*iomap)(struct fwnode_handle *fwnode, int index);
> int (*add_links)(struct fwnode_handle *fwnode);
> };
>
> --
> 2.30.2
>
>
next prev parent reply other threads:[~2022-02-11 15:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-06 9:16 [PATCH 0/4] Shovel firmware specific code to appropriate locations Sakari Ailus
2022-02-06 9:16 ` [PATCH 1/4] device property: Convert device_{dma_supported,get_dma_attr} to fwnode Sakari Ailus
2022-02-07 12:20 ` Andy Shevchenko
2022-02-11 15:55 ` Rob Herring
2022-02-11 16:18 ` Andy Shevchenko
2022-03-08 15:50 ` Rob Herring
2022-02-14 13:31 ` Sakari Ailus
2022-02-06 9:16 ` [PATCH 2/4] ACPI: property: Move acpi_fwnode_device_get_match_data() up Sakari Ailus
2022-02-06 9:16 ` [PATCH 3/4] device property: Add iomap to fwnode operations Sakari Ailus
2022-02-11 15:59 ` Rob Herring [this message]
2022-02-14 10:31 ` Sakari Ailus
2022-02-06 9:16 ` [PATCH 4/4] device property: Add irq_get to fwnode operation Sakari Ailus
2022-02-11 16:02 ` Rob Herring
2022-02-07 12:27 ` [PATCH 0/4] Shovel firmware specific code to appropriate locations Andy Shevchenko
2022-02-07 14:41 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YgaH7iJ5CWSJp1PY@robh.at.kernel.org \
--to=robh@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=djrscally@gmail.com \
--cc=frowand.list@gmail.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox