This commit fixes a compilation error when CONFIG_SPI_BITBANG_VARWIDTH
is set to '=y'.
Change-Id: I8c5eb89cddb588571744d0f7d87670b037c3547c
Signed-off-by: Ivan <ivan.galkin@samsung.com>
* rate.
*/
- shift = priv->nbits - 1 for (bit = 1 << shift; bit != 0; bit >>= 1) {
+ shift = priv->nbits - 1;
+ for (bit = 1 << shift; bit != 0; bit >>= 1) {
/* Shift to make space for the next, less significant bit.
* Then exchange bits with the slave an OR in the new, returned
* bit.
*/
datain <<= 1;
- datain |= exchange(dataout & bit, holdtime);
+ datain |= exchange(!!(dataout & bit), holdtime);
}
return datain;