diff options
author | David Brownell | 2008-08-15 09:40:44 +0200 |
---|---|---|
committer | Linus Torvalds | 2008-08-15 17:35:44 +0200 |
commit | e48880e02e7e7ead9daa47fe3a20486f550668d3 (patch) | |
tree | e46cb1788109caf59fcb77453dffd43fec6e305e /firmware/keyspan/usa18x.HEX | |
parent | fs/inode.c: properly init address_space->writeback_index (diff) | |
download | kernel-qcow2-linux-e48880e02e7e7ead9daa47fe3a20486f550668d3.tar.gz kernel-qcow2-linux-e48880e02e7e7ead9daa47fe3a20486f550668d3.tar.xz kernel-qcow2-linux-e48880e02e7e7ead9daa47fe3a20486f550668d3.zip |
spi: bugfix spi_add_device() with duplicate chipselects
When reviewing a recent patch I noticed a potential trouble spot in the
registration of new SPI devices. The SPI master driver is told to set
the device up before adding it to the driver model, so that it's always
properly set up when probe() is called. (This is important, because in
the case of inverted chipselects, this device can make the bus misbehave
until it's properly deselected. It's got to be set up even if no driver
binds to the device.)
The trouble spot is that it doesn't first verify that no other device
has been added using that chipselect. If such a device has been added,
its configuration gets trashed. (Fortunately this has not been a common
error!)
The fix here adds an explicit check, and a mutex to protect the relevant
critical region.
[akpm@linux-foundation.org: make the lock local to spi_add_device()]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'firmware/keyspan/usa18x.HEX')
0 files changed, 0 insertions, 0 deletions