All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] drivers/tty: pl011: read fifo size from OF if present
Date: Wed, 18 Feb 2015 19:08:34 +0000	[thread overview]
Message-ID: <20150218190834.GJ29429@leverpostej> (raw)
In-Reply-To: <1424285593-2886-3-git-send-email-jorge.ramirez-ortiz@linaro.org>

On Wed, Feb 18, 2015 at 06:53:13PM +0000, Jorge Ramirez-Ortiz wrote:
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> ---
>  drivers/tty/serial/amba-pl011.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 02016fc..23fef63 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -84,6 +84,12 @@ struct vendor_data {
>  
>  static unsigned int get_fifosize_arm(struct amba_device *dev)
>  {
> +	const void *prop;
> +
> +	prop = of_get_property(dev->dev.of_node, "fifo-size", NULL);
> +	if (prop)
> +		return of_read_ulong(prop, 1);

Use of_property_read_u32.

You will need to sanity check the result, also.

What value do you need for your platform?

Mark.

> +
>  	return amba_rev(dev) < 3 ? 16 : 32;
>  }
>  
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Jorge Ramirez-Ortiz
	<jorge.ramirez-ortiz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org"
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/2] drivers/tty: pl011: read fifo size from OF if present
Date: Wed, 18 Feb 2015 19:08:34 +0000	[thread overview]
Message-ID: <20150218190834.GJ29429@leverpostej> (raw)
In-Reply-To: <1424285593-2886-3-git-send-email-jorge.ramirez-ortiz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On Wed, Feb 18, 2015 at 06:53:13PM +0000, Jorge Ramirez-Ortiz wrote:
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  drivers/tty/serial/amba-pl011.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 02016fc..23fef63 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -84,6 +84,12 @@ struct vendor_data {
>  
>  static unsigned int get_fifosize_arm(struct amba_device *dev)
>  {
> +	const void *prop;
> +
> +	prop = of_get_property(dev->dev.of_node, "fifo-size", NULL);
> +	if (prop)
> +		return of_read_ulong(prop, 1);

Use of_property_read_u32.

You will need to sanity check the result, also.

What value do you need for your platform?

Mark.

> +
>  	return amba_rev(dev) < 3 ? 16 : 32;
>  }
>  
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-02-18 19:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 18:53 amba uarts - arm type uarts fifo size provided by device tree Jorge Ramirez-Ortiz
     [not found] ` <1424285593-2886-1-git-send-email-jorge.ramirez-ortiz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-02-18 18:53   ` [PATCH 1/2] Documentation: bindings: add optional fifo size property to AMBA UARTs Jorge Ramirez-Ortiz
2015-02-18 18:53   ` [PATCH 2/2] drivers/tty: pl011: read fifo size from OF if present Jorge Ramirez-Ortiz
2015-02-18 19:08     ` Mark Rutland [this message]
2015-02-18 19:08       ` Mark Rutland
2015-02-18 19:06 ` amba uarts - arm type uarts fifo size provided by device tree Mark Rutland
2015-02-18 19:06   ` Mark Rutland
2015-02-18 19:33   ` Jorge Ramirez-Ortiz
2015-02-18 19:33     ` Jorge Ramirez-Ortiz
2015-02-19  0:34     ` Russell King - ARM Linux
2015-02-19  0:34       ` Russell King - ARM Linux
2015-02-19  0:48       ` Jorge Ramirez-Ortiz
2015-02-19  0:48         ` Jorge Ramirez-Ortiz
     [not found] <amba uarts - arm type uarts fifo size provided by device tree>
2015-02-18 20:07 ` [version 2] " Jorge Ramirez-Ortiz
2015-02-18 20:07   ` [PATCH 2/2] drivers/tty: pl011: read fifo size from OF if present Jorge Ramirez-Ortiz
2015-02-18 20:07     ` Jorge Ramirez-Ortiz
2015-03-03 15:39     ` Jorge Ramirez-Ortiz
2015-03-03 15:39       ` Jorge Ramirez-Ortiz

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=20150218190834.GJ29429@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.