]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
staging: ralink-gdma: Check return code of device_reset
authorGiovanni Gherdovich <bobdc9664@seznam.cz>
Sat, 6 Mar 2021 14:13:22 +0000 (15:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:25:33 +0000 (09:25 +0100)
The device_reset() function is marked as "__must_check", thus the static
analysis tool "sparse" complains that in ralink-gdma its return value is
ignored. Log a warning in case it returns an error.

Signed-off-by: Giovanni Gherdovich <bobdc9664@seznam.cz>
Link: https://lore.kernel.org/r/20210306141322.7516-1-bobdc9664@seznam.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ralink-gdma/ralink-gdma.c

index 655df317d0ee338b3861adc5b122559f968538b7..3c26b665ee7c3af507717c45dabdb3af75c93d99 100644 (file)
@@ -833,7 +833,9 @@ 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: %d\n", ret);
 
        dd = &dma_dev->ddev;
        dma_cap_set(DMA_MEMCPY, dd->cap_mask);