staging: spi: mt7621: Add return code check on device_reset()
authorStefan Roese <sr@denx.de>
Fri, 1 Feb 2019 10:17:09 +0000 (11:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Feb 2019 11:34:36 +0000 (12:34 +0100)
This patch adds a return code check on device_reset() and removes the
compile warning.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Sankalp Negi <sankalpnegi2310@gmail.com>
Cc: Chuanhong Guo <gch981213@gmail.com>
Cc: John Crispin <john@phrozen.org>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-spi/spi-mt7621.c

index 440c3f7..ca46327 100644 (file)
@@ -321,6 +321,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
        int status = 0;
        struct clk *clk;
        struct mt7621_spi_ops *ops;
+       int ret;
 
        match = of_match_device(mt7621_spi_match, &pdev->dev);
        if (!match)
@@ -368,7 +369,11 @@ static int mt7621_spi_probe(struct platform_device *pdev)
        rs->pending_write = 0;
        dev_info(&pdev->dev, "sys_freq: %u\n", rs->sys_freq);
 
-       device_reset(&pdev->dev);
+       ret = device_reset(&pdev->dev);
+       if (ret) {
+               dev_err(&pdev->dev, "SPI reset failed!\n");
+               return ret;
+       }
 
        mt7621_spi_reset(rs);