Subject: Re: [PATCH 1/4] [SPI] spi_mpc83xx: convert to the OF platform driver

From: Anton Vorontsov <[email-masked]>
Date: Wed, 21 May 2008 21:05:06 +0400

On Wed, May 21, 2008 at 10:50:02AM -0600, Grant Likely wrote:
[..]
> > +
> > +       master->num_chipselect = of_num_children(np);
> 
> This assumes that there are no gaps in the assigned CS numbers of
> child nodes, or that the child nodes are an exhaustive list of
> attached devices, neither of which may be true.  num_chipselect should
> be calculated from the number of GPIOs specified instead.

[I'm not arguing just a thought.]

- every SPI device must have its own chip-select, otherwise SPI device
  node should not be a part of a SPI controller node;
- or there is just once device on the SPI bus with chip-select always
  asserted, no gpios = <> is specified (this case is implemented);
- or the SPI is bridged, gpios = <> should list behind-the-bridge devices'
  chip-selects, and driver should understand that there is a "special"
  (bridge) device somewhere on the bus (not implemented).

-- 
Anton Vorontsov
email: [email-masked]
irc://irc.freenode.net/bd2