diff options
-rw-r--r-- | drivers/hwmon/lm70.c | 4 | ||||
-rw-r--r-- | include/linux/spi/spi.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c index 7eaae3834e15..275d392eca61 100644 --- a/drivers/hwmon/lm70.c +++ b/drivers/hwmon/lm70.c | |||
@@ -96,6 +96,10 @@ static int __devinit lm70_probe(struct spi_device *spi) | |||
96 | struct lm70 *p_lm70; | 96 | struct lm70 *p_lm70; |
97 | int status; | 97 | int status; |
98 | 98 | ||
99 | /* signaling is SPI_MODE_0 on a 3-wire link (shared SI/SO) */ | ||
100 | if ((spi->mode & (SPI_CPOL|SPI_CPHA)) || !(spi->mode & SPI_3WIRE)) | ||
101 | return -EINVAL; | ||
102 | |||
99 | p_lm70 = kzalloc(sizeof *p_lm70, GFP_KERNEL); | 103 | p_lm70 = kzalloc(sizeof *p_lm70, GFP_KERNEL); |
100 | if (!p_lm70) | 104 | if (!p_lm70) |
101 | return -ENOMEM; | 105 | return -ENOMEM; |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 1be5ea059477..302b81d1d117 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -76,6 +76,7 @@ struct spi_device { | |||
76 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) | 76 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) |
77 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ | 77 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ |
78 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ | 78 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ |
79 | #define SPI_3WIRE 0x10 /* SI/SO signals shared */ | ||
79 | u8 bits_per_word; | 80 | u8 bits_per_word; |
80 | int irq; | 81 | int irq; |
81 | void *controller_state; | 82 | void *controller_state; |