Re: [PATCH 4/5] spi: spi-gpio: Make optional chipselect handling more explicit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

On Mon, Jan 1, 2018 at 2:37 PM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> I don't like the use of a NULL GPIO descriptor to handle the
> "no chipselect connected" case, as it makes the code hard to read.
> Use a clear bool "has_cs" that we use to explicitly handle the
> case when no chip select is connected to it is clear to readers
> how this is achieved.

Hmm, having two indicators for the same feature (spi_gpio->has_cs == true and
spi_gpio->cs_gpios[0] = NULL), and the need to keep them in sync in the
future, also complicates things.

> When there is no chip select connected, we don't even allocate a
> placeholder for the GPIO descriptor.

That's good, although it may have no effect on actual memory consumption
due to slab granularity.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux