From 4f9780e374c97f892ce83b0c3ec49cc5ee1ea363 Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Sat, 24 Feb 2024 16:39:24 +0800 Subject: [PATCH] spi: spidev-rkslv: Fix compiler error Change-Id: Ie6e3d11b43b557fcfd7e5f1a412a32ff00d84068 Signed-off-by: Jon Lin --- drivers/spi/spidev-rkmst.c | 10 ++++------ drivers/spi/spidev-rkslv.c | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spidev-rkmst.c b/drivers/spi/spidev-rkmst.c index a969adf5ec91..118aa3c4b559 100644 --- a/drivers/spi/spidev-rkmst.c +++ b/drivers/spi/spidev-rkmst.c @@ -442,11 +442,11 @@ static ssize_t spidev_rkmst_misc_write(struct file *filp, const char __user *buf if (!tempbuf) return -ENOMEM; - prandom_bytes(tempbuf, len); + get_random_bytes(tempbuf, len); spidev_rkmst_xfer(spidev, tempbuf, NULL, addr, len); start_time = ktime_get(); for (i = 0; i < loops; i++) { - prandom_bytes(spidev->txbuf, len); + get_random_bytes(spidev->txbuf, len); spidev_rkmst_xfer(spidev, spidev->txbuf, spidev->rxbuf, addr, len); if (memcmp(spidev->rxbuf, tempbuf, len)) { dev_err(&spi->dev, "dulplex autotest failed, loops=%d\n", i); @@ -487,7 +487,7 @@ static ssize_t spidev_rkmst_misc_write(struct file *filp, const char __user *buf start_time = ktime_get(); for (i = 0; i < loops; i++) { - prandom_bytes(spidev->txbuf, len); + get_random_bytes(spidev->txbuf, len); spidev_rkmst_xfer(spidev, spidev->txbuf, NULL, addr, len); spidev_rkmst_xfer(spidev, NULL, spidev->rxbuf, addr, len); if (memcmp(spidev->rxbuf, spidev->txbuf, len)) { @@ -601,13 +601,11 @@ static int spidev_rkmst_probe(struct spi_device *spi) return 0; } -static int spidev_rkmst_remove(struct spi_device *spi) +static void spidev_rkmst_remove(struct spi_device *spi) { struct spidev_rkmst_data *spidev = dev_get_drvdata(&spi->dev); misc_deregister(&spidev->misc_dev); - - return 0; } #ifdef CONFIG_OF diff --git a/drivers/spi/spidev-rkslv.c b/drivers/spi/spidev-rkslv.c index 9f8cfcc6d8ee..e0971ac52a1e 100644 --- a/drivers/spi/spidev-rkslv.c +++ b/drivers/spi/spidev-rkslv.c @@ -108,6 +108,7 @@ static int spidev_slv_write_and_read(struct spidev_rkslv_data *spidev, const voi .tx_buf = tx_buf, .rx_buf = rx_buf, .len = len, + .bits_per_word = bit_per_word, }; struct spi_message m; int ret; @@ -375,7 +376,7 @@ static int spidev_rkslv_probe(struct spi_device *spi) return 0; } -static int spidev_rkslv_remove(struct spi_device *spi) +static void spidev_rkslv_remove(struct spi_device *spi) { struct spidev_rkslv_data *spidev = dev_get_drvdata(&spi->dev); @@ -383,8 +384,6 @@ static int spidev_rkslv_remove(struct spi_device *spi) spi_slave_abort(spi); kthread_stop(spidev->tsk); misc_deregister(&spidev->misc_dev); - - return 0; } #ifdef CONFIG_OF