[openwrt/openwrt] ramips: 5.15: handle error from device_reset in SPI ralink driver

LEDE Commits lede-commits at lists.infradead.org
Thu May 11 18:24:37 PDT 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7a2a645801886e150269a8d00c748105774892f3

commit 7a2a645801886e150269a8d00c748105774892f3
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sat May 6 03:33:54 2023 +0200

    ramips: 5.15: handle error from device_reset in SPI ralink driver
    
    Handle error from device reset in SPI ralink driver fixing compilation
    warning:
    
    drivers/spi/spi-rt2880.c: In function 'rt2880_spi_probe':
    drivers/spi/spi-rt2880.c:474:17: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result]
      474 |                 device_reset(&pdev->dev);
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../821-SPI-ralink-add-Ralink-SoC-spi-driver.patch            | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch b/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch
index 5fb0537539..fa119ab211 100644
--- a/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch
+++ b/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch
@@ -41,7 +41,7 @@ Acked-by: John Crispin <blogic at openwrt.org>
  obj-$(CONFIG_SPI_S3C64XX)		+= spi-s3c64xx.o
 --- /dev/null
 +++ b/drivers/spi/spi-rt2880.c
-@@ -0,0 +1,530 @@
+@@ -0,0 +1,535 @@
 +/*
 + * spi-rt2880.c -- Ralink RT288x/RT305x SPI controller driver
 + *
@@ -514,8 +514,13 @@ Acked-by: John Crispin <blogic at openwrt.org>
 +	rs->base = base;
 +	rs->clk = clk;
 +
-+	if (atomic_inc_return(&hw_reset_count) == 1)
-+		device_reset(&pdev->dev);
++	if (atomic_inc_return(&hw_reset_count) == 1) {
++		ret = device_reset(&pdev->dev);
++		if (ret) {
++			dev_err(&pdev->dev, "device_reset error.\n");
++			goto err_master;
++		}
++	}
 +
 +	ret = devm_spi_register_master(&pdev->dev, master);
 +	if (ret < 0) {




More information about the lede-commits mailing list