mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] mfd: syscon: Introduce syscon_base_lookup_by_phandle() function
Date: Fri, 24 Jan 2014 23:10:38 +0100	[thread overview]
Message-ID: <20140124221037.GM16215@pengutronix.de> (raw)
In-Reply-To: <1390497727-1625-1-git-send-email-shc_work@mail.ru>

On Thu, Jan 23, 2014 at 09:22:04PM +0400, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied this series.

Thanks
 Sascha

> ---
>  drivers/mfd/syscon.c | 20 ++++++++++++++++++++
>  include/mfd/syscon.h |  8 ++++++++
>  2 files changed, 28 insertions(+)
> 
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index 52cb433..6437344 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -41,6 +41,26 @@ void __iomem *syscon_base_lookup_by_pdevname(const char *s)
>  	return ERR_PTR(-ENODEV);
>  }
>  
> +void __iomem *syscon_base_lookup_by_phandle(struct device_node *np,
> +					    const char *property)
> +{
> +	struct device_node *node;
> +	struct syscon *syscon;
> +	struct device_d *dev;
> +
> +	node = of_parse_phandle(np, property, 0);
> +	if (!node)
> +		return ERR_PTR(-ENODEV);
> +
> +	dev = of_find_device_by_node(node);
> +	if (!dev)
> +		return ERR_PTR(-ENODEV);
> +
> +	syscon = dev->priv;
> +
> +	return syscon->base;
> +}
> +
>  static int syscon_probe(struct device_d *dev)
>  {
>  	struct syscon *syscon;
> diff --git a/include/mfd/syscon.h b/include/mfd/syscon.h
> index 68432b7..0eccd5c 100644
> --- a/include/mfd/syscon.h
> +++ b/include/mfd/syscon.h
> @@ -16,11 +16,19 @@
>  
>  #ifdef CONFIG_MFD_SYSCON
>  void __iomem *syscon_base_lookup_by_pdevname(const char *);
> +void __iomem *syscon_base_lookup_by_phandle
> +	(struct device_node *np, const char *property);
>  #else
>  static inline void __iomem *syscon_base_lookup_by_pdevname(const char *)
>  {
>  	return NULL;
>  }
> +
> +static inline void __iomem *syscon_base_lookup_by_phandle
> +	(struct device_node *np, const char *property)
> +{
> +	return NULL;
> +}
>  #endif
>  
>  #endif
> -- 
> 1.8.3.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2014-01-24 22:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 17:22 Alexander Shiyan
2014-01-23 17:22 ` [PATCH 2/4] ARM: clps711x: Remove the special name for the syscon driver Alexander Shiyan
2014-01-23 17:22 ` [PATCH 3/4] gpio: clps711x: Update driver Alexander Shiyan
2014-01-23 17:22 ` [PATCH 4/4] serial: " Alexander Shiyan
2014-01-24 22:10 ` Sascha Hauer [this message]

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=20140124221037.GM16215@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=shc_work@mail.ru \
    /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