Thread (16 messages) flat view 16 messages, 6 authors, 2014-06-11

[PATCH 1/2 v2] spi: s3c64xx: use "cs-gpios" from spi node instead of "cs-gpio"

From: dianders@chromium.org (Doug Anderson)
Date: 2014-06-10 18:26:44
Also in: linux-devicetree, linux-samsung-soc

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
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -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...

quoted hunk ↗ jump to hunk
@@ -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".


-Doug
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help