ramips: 6.1: mt7621-dma: add hsdma driver to files
[openwrt/staging/robimarko.git] / target / linux / ramips / patches-6.1 / 109-drivers-mt7621-dma-handle-error-from-device_reset.patch
1 From 3f6dfa25128e428acfba20792bc7506d58806baa Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Sun, 7 May 2023 01:06:17 +0200
4 Subject: [PATCH] drivers: mt7621-dma: handle error from device_reset
5
6 Handle error from device reset to fix compilation warning.
7 Fix compilation warning:
8 drivers/staging/mt7621-dma/hsdma-mt7621.c: In function 'mtk_hsdma_probe':
9 drivers/staging/mt7621-dma/hsdma-mt7621.c:685:9: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result]
10 685 | device_reset(&pdev->dev);
11 | ^~~~~~~~~~~~~~~~~~~~~~~~
12 cc1: all warnings being treated as errors
13
14 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
15 ---
16 drivers/staging/mt7621-dma/hsdma-mt7621.c | 4 +++-
17 1 file changed, 3 insertions(+), 1 deletion(-)
18
19 --- a/drivers/staging/mt7621-dma/hsdma-mt7621.c
20 +++ b/drivers/staging/mt7621-dma/hsdma-mt7621.c
21 @@ -682,7 +682,9 @@ static int mtk_hsdma_probe(struct platfo
22 return ret;
23 }
24
25 - device_reset(&pdev->dev);
26 + ret = device_reset(&pdev->dev);
27 + if (ret)
28 + dev_err(&pdev->dev, "failed to reset device\n");
29
30 dd = &hsdma->ddev;
31 dma_cap_set(DMA_MEMCPY, dd->cap_mask);