[PATCH] spi: misc fixes

This collects some small SPI patches that seem to be missing from the MM tree:

- spi_butterfly kbuild hooks got dropped somehow; this restores them
- quick fix for a (theoretical?) m25p80_write() oops noted by Andrew
- quick fix for a potential config-specific oops for mtd_dataflash()
- minor doc tweaks

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by David Brownell and committed by Greg Kroah-Hartman 7111763d 8275c642

+28 -2
+13
Documentation/spi/spi-summary
··· 115 115 /sys/devices/.../CTLR/spiB.C ... spi_device for on bus "B", 116 116 chipselect C, accessed through CTLR. 117 117 118 + /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver 119 + that should be used with this device (for hotplug/coldplug) 120 + 118 121 /sys/bus/spi/devices/spiB.C ... symlink to the physical 119 122 spiB-C device 120 123 ··· 250 247 251 248 Like with other static board-specific setup, you won't unregister those. 252 249 250 + The widely used "card" style computers bundle memory, cpu, and little else 251 + onto a card that's maybe just thirty square centimeters. On such systems, 252 + your arch/.../mach-.../board-*.c file would primarily provide information 253 + about the devices on the mainboard into which such a card is plugged. That 254 + certainly includes SPI devices hooked up through the card connectors! 255 + 253 256 254 257 NON-STATIC CONFIGURATIONS 255 258 ··· 266 257 up the spi bus master, and will likely need spi_new_device() to provide the 267 258 board info based on the board that was hotplugged. Of course, you'd later 268 259 call at least spi_unregister_device() when that board is removed. 260 + 261 + When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those 262 + configurations will also be dynamic. Fortunately, those devices all support 263 + basic device identification probes, so that support should hotplug normally. 269 264 270 265 271 266 How do I write an "SPI Protocol Driver"?
+3 -1
drivers/mtd/devices/m25p80.c
··· 378 378 379 379 spi_sync(flash->spi, &m); 380 380 381 - *retlen += m.actual_length - sizeof(flash->command); 381 + if (retlen) 382 + *retlen += m.actual_length 383 + - sizeof(flash->command); 382 384 } 383 385 } 384 386
+1 -1
drivers/mtd/devices/mtd_dataflash.c
··· 508 508 priv->partitioned = 1; 509 509 return add_mtd_partitions(device, parts, nr_parts); 510 510 } 511 - } else if (pdata->nr_parts) 511 + } else if (pdata && pdata->nr_parts) 512 512 dev_warn(&spi->dev, "ignoring %d default partitions on %s\n", 513 513 pdata->nr_parts, device->name); 514 514
+10
drivers/spi/Kconfig
··· 65 65 need it. You only need to select this explicitly to support driver 66 66 modules that aren't part of this kernel tree. 67 67 68 + config SPI_BUTTERFLY 69 + tristate "Parallel port adapter for AVR Butterfly (DEVELOPMENT)" 70 + depends on SPI_MASTER && PARPORT && EXPERIMENTAL 71 + select SPI_BITBANG 72 + help 73 + This uses a custom parallel port cable to connect to an AVR 74 + Butterfly <http://www.atmel.com/products/avr/butterfly>, an 75 + inexpensive battery powered microcontroller evaluation board. 76 + This same cable can be used to flash new firmware. 77 + 68 78 # 69 79 # Add new SPI master controllers in alphabetical order above this line 70 80 #
+1
drivers/spi/Makefile
··· 12 12 13 13 # SPI master controller drivers (bus) 14 14 obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o 15 + obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o 15 16 # ... add above this line ... 16 17 17 18 # SPI protocol drivers (device/link on bus)