lkml.org 
[lkml]   [2021]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] staging: fix ignoring return value warning
    Date
    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@loongson.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
    \
     
     \ /
      Last update: 2021-02-07 10:25    [W:30.334 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site