[RFC][PATCH 2/3] spi: enfore default bits_per_word value

Paul Fertser fercerpav at gmail.com
Mon Aug 29 08:39:53 EDT 2011


Documentation says it should default to 8 when not specified
explicitly by the device data.

Signed-off-by: Paul Fertser <fercerpav at gmail.com>
---
 drivers/spi/spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 82393ea..7a8aed4 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -75,7 +75,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
 	proxy->chip_select = chip->chip_select;
 	proxy->max_speed_hz = chip->max_speed_hz;
 	proxy->mode = chip->mode;
-	proxy->bits_per_word = chip->bits_per_word;
+	proxy->bits_per_word = chip->bits_per_word ? chip->bits_per_word : 8;
 	proxy->dev.platform_data = chip->platform_data;
 	strcpy(proxy->dev.name, chip->name);
 	proxy->dev.type_data = proxy;
-- 
1.5.2.2




More information about the barebox mailing list