From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: "Jens Renner (EFE)"
<renner-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] spi: spi-xilinx: Use DT information for bits_per_word value
Date: Sat, 02 Mar 2013 21:22:30 +0000 [thread overview]
Message-ID: <20130302212230.E17D73E220D@localhost> (raw)
In-Reply-To: <51191C11.9070607-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
On Mon, 11 Feb 2013 17:28:01 +0100, "Jens Renner (EFE)" <renner-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org> wrote:
> From: Jens Renner <renner-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
>
> This patch overrides the default value of bits_per_word with the actual value
> of "xlnx,num-transfer-bits" from the DTS file to allow for 16 and 32 bit word
> lengths.
>
> Signed-off-by: Jens Renner <renner-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
> ---
> diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
> index e1d7696..03abdfa 100644
> --- a/drivers/spi/spi-xilinx.c
> +++ b/drivers/spi/spi-xilinx.c
> @@ -487,6 +487,12 @@ static int xilinx_spi_probe(struct platform_device *dev)
> &len);
> if (prop && len >= sizeof(*prop))
> num_cs = __be32_to_cpup(prop);
> +
> + /* override default number of bits per word */
> + prop = of_get_property(dev->dev.of_node,
> + "xlnx,num-transfer-bits", &len);
> + if (prop && len >= sizeof(*prop))
> + bits_per_word = __be32_to_cpup(prop);
Hi Jens,
Please remember to update documentation when modifying a DT binding.
Also, if you use of_property_read_u32() the code will be a lot simpler.
g.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
next prev parent reply other threads:[~2013-03-02 21:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-11 16:28 [PATCH] spi: spi-xilinx: Use DT information for bits_per_word value Jens Renner (EFE)
[not found] ` <51191C11.9070607-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org>
2013-03-02 21:22 ` Grant Likely [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-02-11 14:55 Jens Renner (EFE)
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=20130302212230.E17D73E220D@localhost \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=renner-Xf229rFC5gsb1SvskN2V4Q@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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.