109-drivers-mt7621-dma-handle-error-from-device_reset.patch 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. From 3f6dfa25128e428acfba20792bc7506d58806baa Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Sun, 7 May 2023 01:06:17 +0200
  4. Subject: [PATCH] drivers: mt7621-dma: handle error from device_reset
  5. Handle error from device reset to fix compilation warning.
  6. Fix compilation warning:
  7. drivers/staging/mt7621-dma/hsdma-mt7621.c: In function 'mtk_hsdma_probe':
  8. 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]
  9. 685 | device_reset(&pdev->dev);
  10. | ^~~~~~~~~~~~~~~~~~~~~~~~
  11. cc1: all warnings being treated as errors
  12. Signed-off-by: Christian Marangi <[email protected]>
  13. ---
  14. drivers/staging/mt7621-dma/hsdma-mt7621.c | 4 +++-
  15. 1 file changed, 3 insertions(+), 1 deletion(-)
  16. --- a/drivers/staging/mt7621-dma/hsdma-mt7621.c
  17. +++ b/drivers/staging/mt7621-dma/hsdma-mt7621.c
  18. @@ -682,7 +682,9 @@ static int mtk_hsdma_probe(struct platfo
  19. return ret;
  20. }
  21. - device_reset(&pdev->dev);
  22. + ret = device_reset(&pdev->dev);
  23. + if (ret)
  24. + dev_err(&pdev->dev, "failed to reset device\n");
  25. dd = &hsdma->ddev;
  26. dma_cap_set(DMA_MEMCPY, dd->cap_mask);