Skip to content

Commit

Permalink
implicit declaration of function ‘SPI_BIT_MASK’ gschorcht#9
Browse files Browse the repository at this point in the history
Use SPI_BPW_MASK on the newer kernels.
  • Loading branch information
jdevelop committed Oct 22, 2019
1 parent 79bbe57 commit d5a83bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spi-ch341-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,11 @@ static int ch341_spi_probe (struct ch341_device* ch341_dev)
ch341_dev->master->num_chipselect = CH341_SPI_MAX_NUM_DEVICES;
ch341_dev->master->mode_bits = SPI_MODE_3 | SPI_LSB_FIRST;
ch341_dev->master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(5,0,0)
ch341_dev->master->bits_per_word_mask = SPI_BIT_MASK(8);
#else
ch341_dev->master->bits_per_word_mask = SPI_BPW_MASK(8);
#endif
ch341_dev->master->transfer_one = ch341_spi_transfer_one;
ch341_dev->master->max_speed_hz = CH341_SPI_MAX_FREQ;
ch341_dev->master->min_speed_hz = CH341_SPI_MIN_FREQ;
Expand Down

0 comments on commit d5a83bb

Please sign in to comment.