Skip to content

Commit

Permalink
Merge pull request #10 from jdevelop/fix/build-kernel-5
Browse files Browse the repository at this point in the history
implicit declaration of function ‘SPI_BIT_MASK’ #9
  • Loading branch information
gschorcht committed Oct 23, 2021
2 parents 0dd35b4 + d5a83bb commit 9c4b873
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 9c4b873

Please sign in to comment.