All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Dilip Kota <eswara.kota@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, kishon@ti.com,
	devicetree@vger.kernel.org, arnd@arndb.de, robh@kernel.org,
	andriy.shevchenko@intel.com, cheol.yong.kim@intel.com,
	chuanhua.lei@linux.intel.com, qi-ming.wu@intel.com,
	yixin.zhu@intel.com
Subject: Re: [RESEND PATCH v6 1/4] mfd: syscon: Add fwnode_to_regmap
Date: Fri, 17 Apr 2020 10:35:51 +0100	[thread overview]
Message-ID: <20200417093551.GH2167633@dell> (raw)
In-Reply-To: <9c58aeb1561f28f302921d54aee75942545c4971.1585889042.git.eswara.kota@linux.intel.com>

On Mon, 06 Apr 2020, Dilip Kota wrote:

> Traverse regmap handle entry from firmware node handle.
> 
> Signed-off-by: Dilip Kota <eswara.kota@linux.intel.com>
> ---
> Changes on v5:
>   No changes
>   
> Changes on v5:
>   No changes
> 
> Changes on v4:
>   No changes
> 
>  drivers/mfd/syscon.c       | 8 ++++++++
>  include/linux/mfd/syscon.h | 6 ++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index 3a97816d0cba..e085c50816b9 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -178,6 +178,14 @@ struct regmap *device_node_to_regmap(struct device_node *np)
>  }
>  EXPORT_SYMBOL_GPL(device_node_to_regmap);
>  
> +struct regmap *fwnode_to_regmap(struct fwnode_handle *fwnode)
> +{
> +	struct device_node *np = to_of_node(fwnode);

You are assuming that the fwnode was Device Tree pointer.

The point of a fwnode is that it could be one of multiple types.

What if it was a pointer to an ACPI property?

> +	return device_node_get_regmap(np, false);
> +}
> +EXPORT_SYMBOL_GPL(fwnode_to_regmap);
> +
>  struct regmap *syscon_node_to_regmap(struct device_node *np)
>  {
>  	if (!of_device_is_compatible(np, "syscon"))
> diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
> index 7f20e9b502a5..dacab0b4a091 100644
> --- a/include/linux/mfd/syscon.h
> +++ b/include/linux/mfd/syscon.h
> @@ -18,6 +18,7 @@ struct device_node;
>  
>  #ifdef CONFIG_MFD_SYSCON
>  extern struct regmap *device_node_to_regmap(struct device_node *np);
> +extern struct regmap *fwnode_to_regmap(struct fwnode_handle *fwnode);
>  extern struct regmap *syscon_node_to_regmap(struct device_node *np);
>  extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
>  extern struct regmap *syscon_regmap_lookup_by_phandle(
> @@ -34,6 +35,11 @@ static inline struct regmap *device_node_to_regmap(struct device_node *np)
>  	return ERR_PTR(-ENOTSUPP);
>  }
>  
> +static inline struct regmap *fwnode_to_regmap(struct fwnode_handle *fwnode)
> +{
> +	return ERR_PTR(-ENOTSUPP);
> +}
> +
>  static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
>  {
>  	return ERR_PTR(-ENOTSUPP);

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2020-04-17  9:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03  5:04 [PATCH v6 0/4] Add Intel ComboPhy driver Dilip Kota
2020-04-06  7:39 ` [RESEND PATCH " Dilip Kota
2020-04-03  5:04 ` [PATCH v6 1/4] mfd: syscon: Add fwnode_to_regmap Dilip Kota
2020-04-06  7:39   ` [RESEND PATCH " Dilip Kota
2020-04-17  9:35   ` Lee Jones [this message]
2020-04-21  4:06     ` Dilip Kota
2020-04-28 10:05       ` Lee Jones
2020-04-28 10:29         ` Arnd Bergmann
2020-04-29  5:11           ` Dilip Kota
2020-04-03  5:04 ` [PATCH v6 2/4] dt-bindings: phy: Add PHY_TYPE_XPCS definition Dilip Kota
2020-04-06  7:39   ` [RESEND PATCH " Dilip Kota
2020-04-03  5:04 ` [PATCH v6 3/4] dt-bindings: phy: Add YAML schemas for Intel ComboPhy Dilip Kota
2020-04-06  7:39   ` [RESEND PATCH " Dilip Kota
2020-04-03  5:04 ` [PATCH v6 4/4] phy: intel: Add driver support for ComboPhy Dilip Kota
2020-04-06  7:39   ` [RESEND PATCH " Dilip Kota

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=20200417093551.GH2167633@dell \
    --to=lee.jones@linaro.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=arnd@arndb.de \
    --cc=cheol.yong.kim@intel.com \
    --cc=chuanhua.lei@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eswara.kota@linux.intel.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qi-ming.wu@intel.com \
    --cc=robh@kernel.org \
    --cc=yixin.zhu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.