spi: Fixes for v3.14

A few driver and documentation fixes, plus a fix for double error
 handling which had crept in due to the confusing documentation - it
 wasn't clear if the core or the driver was responsible for cleanup
 in error cases so both tried to do it with unfortunate results.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJS+haUAAoJELSic+t+oim9wLMP/idNnHkp7sNPrc6dlC+ZpFEY
 Dat8RJCO0NAEZIO/CBWaCx47WMVj51VVFxWXf/fp6djwPFcG0BY6OU2xixEOZn//
 4u2nmCWA5bQCYBaItxKggZe407/vaBU+9R6XIK5mMHGQyrEZX/88z4N61S4CzrK4
 F0GJO1KW3ypi4jI6193Cwuw1T6Gr3GYzu/gD5Yo1kZq5hTRoIt/gFSrolH9Z2yXS
 YOJWTWTXzrtGJ/UVD09ukjV9pdxk6qNHp0jtGe+H3RGditPyWuPyttWZIPKR6zdl
 GCd11oIGOjzSFbFwDHXocKP+o2oL8Xc6HoD6GK2LHGnHjXO2OZasVsEuQXAlRUSR
 X7jr6i+NXiFwuKfbLMdbRahfUWDkFp2rhyJvWpgLZg26dyHiHvpT5CIfT/ep948K
 PEoUeXYZXR8u3LgG+WVCcZaVL1VUyDCrvSzVL3C3vx0yGuna1nj7ybKzPPtb96Ub
 XB4qNow4FfvubM4ierjZwjZqTSlMjPeXGH1hMUtZYQpUGCS1TuDMElAtWKAxd3ip
 7aESg+b+kkfqUulZ9ObGf1K3h7MhH52/sqKbBWUi3DS2BnCGIEqkl+qfBnqBSHwS
 cNxCgIg4ohxkEt3DUH1T2+8vAwQSawhjlS/4h+Al+tdzG4HAP7D/cDaCBWFiNf+7
 vqvISqHUdpKLPYYF4sON
 =rORX
 -----END PGP SIGNATURE-----

Merge tag 'spi-v3.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few driver and documentation fixes, plus a fix for double error
  handling which had crept in due to the confusing documentation - it
  wasn't clear if the core or the driver was responsible for cleanup in
  error cases so both tried to do it with unfortunate results"

* tag 'spi-v3.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: nuc900: Set SPI_LSB_FIRST for master->mode_bits if hw->pdata->lsb is true
  spi: rspi: Document support for Renesas QSPI in Kconfig
  spi: Fix crash with double message finalisation on error handling
  spi: correct the transfer_one_message documentation wording
  spi: document the transfer_one spi_master callback
  spi: spi.h: clarify the documentation of transfer_one
This commit is contained in:
Linus Torvalds 2014-02-12 09:11:24 -08:00
commit 7df4d0c978
5 changed files with 26 additions and 8 deletions

View file

@ -543,7 +543,22 @@ SPI MASTER METHODS
queuing transfers that arrive in the meantime. When the driver is queuing transfers that arrive in the meantime. When the driver is
finished with this message, it must call finished with this message, it must call
spi_finalize_current_message() so the subsystem can issue the next spi_finalize_current_message() so the subsystem can issue the next
transfer. This may sleep. message. This may sleep.
master->transfer_one(struct spi_master *master, struct spi_device *spi,
struct spi_transfer *transfer)
The subsystem calls the driver to transfer a single transfer while
queuing transfers that arrive in the meantime. When the driver is
finished with this transfer, it must call
spi_finalize_current_transfer() so the subsystem can issue the next
transfer. This may sleep. Note: transfer_one and transfer_one_message
are mutually exclusive; when both are set, the generic subsystem does
not call your transfer_one callback.
Return values:
negative errno: error
0: transfer is finished
1: transfer is still in progress
DEPRECATED METHODS DEPRECATED METHODS

View file

@ -376,10 +376,10 @@ config SPI_PXA2XX_PCI
def_tristate SPI_PXA2XX && PCI def_tristate SPI_PXA2XX && PCI
config SPI_RSPI config SPI_RSPI
tristate "Renesas RSPI controller" tristate "Renesas RSPI/QSPI controller"
depends on (SUPERH && SH_DMAE_BASE) || ARCH_SHMOBILE depends on (SUPERH && SH_DMAE_BASE) || ARCH_SHMOBILE
help help
SPI driver for Renesas RSPI blocks. SPI driver for Renesas RSPI and QSPI blocks.
config SPI_S3C24XX config SPI_S3C24XX
tristate "Samsung S3C24XX series SPI" tristate "Samsung S3C24XX series SPI"

View file

@ -361,6 +361,8 @@ static int nuc900_spi_probe(struct platform_device *pdev)
init_completion(&hw->done); init_completion(&hw->done);
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
if (hw->pdata->lsb)
master->mode_bits |= SPI_LSB_FIRST;
master->num_chipselect = hw->pdata->num_cs; master->num_chipselect = hw->pdata->num_cs;
master->bus_num = hw->pdata->bus_num; master->bus_num = hw->pdata->bus_num;
hw->bitbang.master = hw->master; hw->bitbang.master = hw->master;

View file

@ -755,9 +755,7 @@ static void spi_pump_messages(struct kthread_work *work)
ret = master->transfer_one_message(master, master->cur_msg); ret = master->transfer_one_message(master, master->cur_msg);
if (ret) { if (ret) {
dev_err(&master->dev, dev_err(&master->dev,
"failed to transfer one message from queue: %d\n", ret); "failed to transfer one message from queue\n");
master->cur_msg->status = ret;
spi_finalize_current_message(master);
return; return;
} }
} }

View file

@ -273,7 +273,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
* message while queuing transfers that arrive in the meantime. When the * message while queuing transfers that arrive in the meantime. When the
* driver is finished with this message, it must call * driver is finished with this message, it must call
* spi_finalize_current_message() so the subsystem can issue the next * spi_finalize_current_message() so the subsystem can issue the next
* transfer * message
* @unprepare_transfer_hardware: there are currently no more messages on the * @unprepare_transfer_hardware: there are currently no more messages on the
* queue so the subsystem notifies the driver that it may relax the * queue so the subsystem notifies the driver that it may relax the
* hardware by issuing this call * hardware by issuing this call
@ -287,7 +287,10 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
* - return 1 if the transfer is still in progress. When * - return 1 if the transfer is still in progress. When
* the driver is finished with this transfer it must * the driver is finished with this transfer it must
* call spi_finalize_current_transfer() so the subsystem * call spi_finalize_current_transfer() so the subsystem
* can issue the next transfer * can issue the next transfer. Note: transfer_one and
* transfer_one_message are mutually exclusive; when both
* are set, the generic subsystem does not call your
* transfer_one callback.
* @unprepare_message: undo any work done by prepare_message(). * @unprepare_message: undo any work done by prepare_message().
* @cs_gpios: Array of GPIOs to use as chip select lines; one per CS * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS
* number. Any individual value may be -ENOENT for CS lines that * number. Any individual value may be -ENOENT for CS lines that