[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1612689808-30985-1-git-send-email-tangyouling@loongson.cn>
Date: Sun, 7 Feb 2021 17:23:28 +0800
From: Youling Tang <tangyouling@...ngson.cn>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Matthias Brugger <matthias.bgg@...il.com>
Cc: devel@...verdev.osuosl.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
tangyouling@...ngson.cn
Subject: [PATCH] staging: fix ignoring return value warning
Fix the below ignoring return value warning for device_reset.
drivers/staging/mt7621-dma/mtk-hsdma.c:685:2: warning: ignoring return value
of function declared with 'warn_unused_result' attribute [-Wunused-result]
device_reset(&pdev->dev);
^~~~~~~~~~~~ ~~~~~~~~~~
drivers/staging/ralink-gdma/ralink-gdma.c:836:2: warning: ignoring return value
of function declared with 'warn_unused_result' attribute [-Wunused-result]
device_reset(&pdev->dev);
^~~~~~~~~~~~ ~~~~~~~~~~
Signed-off-by: Youling Tang <tangyouling@...ngson.cn>
---
drivers/staging/mt7621-dma/mtk-hsdma.c | 6 +++++-
drivers/staging/ralink-gdma/ralink-gdma.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c b/drivers/staging/mt7621-dma/mtk-hsdma.c
index bc4bb43..d4ffa52 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -682,7 +682,11 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
return ret;
}
- device_reset(&pdev->dev);
+ ret = device_reset(&pdev->dev);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to reset device\n");
+ return ret;
+ }
dd = &hsdma->ddev;
dma_cap_set(DMA_MEMCPY, dd->cap_mask);
diff --git a/drivers/staging/ralink-gdma/ralink-gdma.c b/drivers/staging/ralink-gdma/ralink-gdma.c
index 655df31..df99c47 100644
--- a/drivers/staging/ralink-gdma/ralink-gdma.c
+++ b/drivers/staging/ralink-gdma/ralink-gdma.c
@@ -833,7 +833,11 @@ static int gdma_dma_probe(struct platform_device *pdev)
return ret;
}
- device_reset(&pdev->dev);
+ ret = device_reset(&pdev->dev);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to reset device\n");
+ return ret;
+ }
dd = &dma_dev->ddev;
dma_cap_set(DMA_MEMCPY, dd->cap_mask);
--
2.1.0
Powered by blists - more mailing lists