From: Tomasz Figa <tomasz.figa@gmail.com>
To: Doug Anderson <dianders@chromium.org>,
Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
spi-devel-general@lists.sourceforge.net,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
Naveen Krishna <naveenkrishna.ch@gmail.com>,
"broonie@kernel.org" <broonie@kernel.org>,
Grant Likely <grant.likely@secretlab.ca>,
Jaswinder Singh <jaswinder.singh@linaro.org>,
Kukjin Kim <kgene.kim@samsung.com>, "cpgs ." <cpgs@samsung.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Subject: Re: [PATCH 1/2 v2] spi: s3c64xx: use "cs-gpios" from spi node instead of "cs-gpio"
Date: Tue, 10 Jun 2014 21:25:40 +0200 [thread overview]
Message-ID: <53975BB4.6040104@gmail.com> (raw)
In-Reply-To: <CAD=FV=WgvyF-P+69SdmCGX0jxJ3FVxpa+AcgQKg-Emya_W-w3Q@mail.gmail.com>
On 10.06.2014 20:26, Doug Anderson wrote:
> Naveen,
>
> Not a full review, but a few quick things I happened to notice:
>
> On Tue, Jun 10, 2014 at 3:08 AM, Naveen Krishna Chatradhi
> <ch.naveen@samsung.com> wrote:
>> @@ -94,7 +93,6 @@ Example:
>> spi-max-frequency = <10000>;
>>
>> controller-data {
>> - cs-gpio = <&gpa2 5 1 0 3>;
>> samsung,spi-feedback-delay = <0>;
>
> In a future patch (not this one!) it might make sense to also move
> spi-feedback-delay out.
>
>
>> +static struct s3c64xx_spi_csinfo *s3c64xx_get_cs_gpios(struct spi_device *spi)
>
> I believe that you can make use of the fact that the SPI core already
> got these GPIOs for you. See of_spi_register_master(). Everything
> you need ought to be in master->num_chipselect and master->cs_gpios.
>
> Strangely, it doesn't look like any other drivers use this, so
> possibly I'm confused...
>
>
>> @@ -806,9 +815,14 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
>> struct s3c64xx_spi_info *sci;
>> int err;
>>
>> + if (!spi->dev.of_node) {
>> + dev_err(&spi->dev, "device node not found\n");
>> + return -EINVAL;
>> + }
>
> This seems incredibly broken. You're saying that the SPI driver no
> longer works without the device tree? I don't think that's desirable,
> but I suppose I could be wrong.
>
> Also note that you still left an "if" test below for trying to deal
> with the fact that there is no "of_node".
This driver can be also used by non-DT platforms (namely s3c2443,
s3c64xx and s5p*) and so this assumption is wrong.
Best regards,
Tomasz
WARNING: multiple messages have this Message-ID (diff)
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2 v2] spi: s3c64xx: use "cs-gpios" from spi node instead of "cs-gpio"
Date: Tue, 10 Jun 2014 21:25:40 +0200 [thread overview]
Message-ID: <53975BB4.6040104@gmail.com> (raw)
In-Reply-To: <CAD=FV=WgvyF-P+69SdmCGX0jxJ3FVxpa+AcgQKg-Emya_W-w3Q@mail.gmail.com>
On 10.06.2014 20:26, Doug Anderson wrote:
> Naveen,
>
> Not a full review, but a few quick things I happened to notice:
>
> On Tue, Jun 10, 2014 at 3:08 AM, Naveen Krishna Chatradhi
> <ch.naveen@samsung.com> wrote:
>> @@ -94,7 +93,6 @@ Example:
>> spi-max-frequency = <10000>;
>>
>> controller-data {
>> - cs-gpio = <&gpa2 5 1 0 3>;
>> samsung,spi-feedback-delay = <0>;
>
> In a future patch (not this one!) it might make sense to also move
> spi-feedback-delay out.
>
>
>> +static struct s3c64xx_spi_csinfo *s3c64xx_get_cs_gpios(struct spi_device *spi)
>
> I believe that you can make use of the fact that the SPI core already
> got these GPIOs for you. See of_spi_register_master(). Everything
> you need ought to be in master->num_chipselect and master->cs_gpios.
>
> Strangely, it doesn't look like any other drivers use this, so
> possibly I'm confused...
>
>
>> @@ -806,9 +815,14 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
>> struct s3c64xx_spi_info *sci;
>> int err;
>>
>> + if (!spi->dev.of_node) {
>> + dev_err(&spi->dev, "device node not found\n");
>> + return -EINVAL;
>> + }
>
> This seems incredibly broken. You're saying that the SPI driver no
> longer works without the device tree? I don't think that's desirable,
> but I suppose I could be wrong.
>
> Also note that you still left an "if" test below for trying to deal
> with the fact that there is no "of_node".
This driver can be also used by non-DT platforms (namely s3c2443,
s3c64xx and s5p*) and so this assumption is wrong.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-06-10 19:26 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 10:07 [PATCH 0/2 v2] spi: s3c64xx: use "cs-gpios" in spi node instead of "cs-gpio" Naveen Krishna Chatradhi
2014-06-10 10:07 ` Naveen Krishna Chatradhi
2014-06-10 10:08 ` [PATCH 1/2 v2] spi: s3c64xx: use "cs-gpios" from " Naveen Krishna Chatradhi
2014-06-10 10:08 ` Naveen Krishna Chatradhi
2014-06-10 10:39 ` Sylwester Nawrocki
2014-06-10 10:39 ` Sylwester Nawrocki
2014-06-10 11:00 ` Naveen Krishna Ch
2014-06-10 11:00 ` Naveen Krishna Ch
2014-06-10 18:09 ` Doug Anderson
2014-06-10 18:09 ` Doug Anderson
2014-06-10 19:43 ` Tomasz Figa
2014-06-10 19:43 ` Tomasz Figa
2014-06-10 20:32 ` Rob Herring
2014-06-10 20:32 ` Rob Herring
2014-06-11 12:22 ` Sylwester Nawrocki
2014-06-11 12:22 ` Sylwester Nawrocki
2014-06-10 18:26 ` Doug Anderson
2014-06-10 18:26 ` Doug Anderson
2014-06-10 19:25 ` Tomasz Figa [this message]
2014-06-10 19:25 ` Tomasz Figa
[not found] ` <CAD=FV=WgvyF-P+69SdmCGX0jxJ3FVxpa+AcgQKg-Emya_W-w3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-11 6:10 ` Naveen Krishna Ch
2014-06-11 6:10 ` Naveen Krishna Ch
2014-06-10 19:49 ` Tomasz Figa
2014-06-10 19:49 ` Tomasz Figa
2014-06-10 19:58 ` Doug Anderson
2014-06-10 19:58 ` Doug Anderson
2014-06-10 19:59 ` Tomasz Figa
2014-06-10 19:59 ` Tomasz Figa
2014-06-10 20:21 ` Doug Anderson
2014-06-10 20:21 ` Doug Anderson
2014-06-11 6:16 ` Naveen Krishna Ch
2014-06-11 6:16 ` Naveen Krishna Ch
2014-06-10 10:08 ` [PATCH 2/2 v2] ARM: DTS: move "cs-gpio" from "controller-data" to under spi node Naveen Krishna Chatradhi
2014-06-10 10:08 ` Naveen Krishna Chatradhi
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=53975BB4.6040104@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=broonie@kernel.org \
--cc=ch.naveen@samsung.com \
--cc=cpgs@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=grant.likely@secretlab.ca \
--cc=jaswinder.singh@linaro.org \
--cc=javier.martinez@collabora.co.uk \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=naveenkrishna.ch@gmail.com \
--cc=spi-devel-general@lists.sourceforge.net \
/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.