]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.34/staging-spi-mt7621-add-return-code-check-on-device_r.patch
Linux 4.19.34
[thirdparty/kernel/stable-queue.git] / releases / 4.19.34 / staging-spi-mt7621-add-return-code-check-on-device_r.patch
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()
5
6 [ Upstream commit 46c337872f34bc6387b0c29a4964f562c70139e3 ]
7
8 This patch adds a return code check on device_reset() and removes the
9 compile warning.
10
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>
19 ---
20 drivers/staging/mt7621-spi/spi-mt7621.c | 7 ++++++-
21 1 file changed, 6 insertions(+), 1 deletion(-)
22
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)
28 int status = 0;
29 struct clk *clk;
30 struct mt7621_spi_ops *ops;
31 + int ret;
32
33 match = of_match_device(mt7621_spi_match, &pdev->dev);
34 if (!match)
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);
38
39 - device_reset(&pdev->dev);
40 + ret = device_reset(&pdev->dev);
41 + if (ret) {
42 + dev_err(&pdev->dev, "SPI reset failed!\n");
43 + return ret;
44 + }
45
46 mt7621_spi_reset(rs, 0);
47
48 --
49 2.19.1
50