1 From 8b193362def74887b8973ff84d6aac1698b8e3d1 Mon Sep 17 00:00:00 2001
2 From: Stefan Roese <sr@denx.de>
3 Date: Fri, 1 Feb 2019 11:17:09 +0100
4 Subject: staging: spi: mt7621: Add return code check on device_reset()
6 [ Upstream commit 46c337872f34bc6387b0c29a4964f562c70139e3 ]
8 This patch adds a return code check on device_reset() and removes the
11 Signed-off-by: Stefan Roese <sr@denx.de>
12 Cc: Mark Brown <broonie@kernel.org>
13 Cc: Sankalp Negi <sankalpnegi2310@gmail.com>
14 Cc: Chuanhong Guo <gch981213@gmail.com>
15 Cc: John Crispin <john@phrozen.org>
16 Reviewed-by: NeilBrown <neil@brown.name>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 drivers/staging/mt7621-spi/spi-mt7621.c | 7 ++++++-
21 1 file changed, 6 insertions(+), 1 deletion(-)
23 diff --git a/drivers/staging/mt7621-spi/spi-mt7621.c b/drivers/staging/mt7621-spi/spi-mt7621.c
24 index d045b5568e0f..578aa6824ad3 100644
25 --- a/drivers/staging/mt7621-spi/spi-mt7621.c
26 +++ b/drivers/staging/mt7621-spi/spi-mt7621.c
27 @@ -429,6 +429,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
30 struct mt7621_spi_ops *ops;
33 match = of_match_device(mt7621_spi_match, &pdev->dev);
35 @@ -476,7 +477,11 @@ static int mt7621_spi_probe(struct platform_device *pdev)
36 rs->pending_write = 0;
37 dev_info(&pdev->dev, "sys_freq: %u\n", rs->sys_freq);
39 - device_reset(&pdev->dev);
40 + ret = device_reset(&pdev->dev);
42 + dev_err(&pdev->dev, "SPI reset failed!\n");
46 mt7621_spi_reset(rs, 0);