ipq806x: sync with latest patches sent by QCA
[openwrt/staging/dedeckeh.git] / target / linux / ipq806x / patches-4.4 / 099-usb-dwc3-Remove-impossible-check-for-of_clk_get_pare.patch
1 From 07c8b15688055d81ac8e1c8c964b9e4c302287f1 Mon Sep 17 00:00:00 2001
2 From: Stephen Boyd <sboyd@codeaurora.org>
3 Date: Mon, 22 Feb 2016 11:12:47 -0800
4 Subject: [PATCH] usb: dwc3: Remove impossible check for
5 of_clk_get_parent_count() < 0
6
7 The check for < 0 is impossible now that
8 of_clk_get_parent_count() returns an unsigned int. Simplify the
9 code and update the types.
10
11 Acked-by: Felipe Balbi <balbi@kernel.org>
12 Cc: <linux-usb@vger.kernel.org>
13 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
14 (cherry picked from commit 3d755dcc20dd452b52532eca17da40ebbd12aee9)
15
16 Change-Id: Iaa38e064d801fb36c855fea51c0443840368e0d3
17 Signed-off-by: Nitheesh Sekar <nsekar@codeaurora.org>
18 ---
19 drivers/usb/dwc3/dwc3-of-simple.c | 9 +++++----
20 1 file changed, 5 insertions(+), 4 deletions(-)
21
22 diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
23 index 9c9f741..9743353 100644
24 --- a/drivers/usb/dwc3/dwc3-of-simple.c
25 +++ b/drivers/usb/dwc3/dwc3-of-simple.c
26 @@ -42,6 +42,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
27 struct device *dev = &pdev->dev;
28 struct device_node *np = dev->of_node;
29
30 + unsigned int count;
31 int ret;
32 int i;
33
34 @@ -49,11 +50,11 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
35 if (!simple)
36 return -ENOMEM;
37
38 - ret = of_clk_get_parent_count(np);
39 - if (ret < 0)
40 - return ret;
41 + count = of_clk_get_parent_count(np);
42 + if (!count)
43 + return -ENOENT;
44
45 - simple->num_clocks = ret;
46 + simple->num_clocks = count;
47
48 simple->clks = devm_kcalloc(dev, simple->num_clocks,
49 sizeof(struct clk *), GFP_KERNEL);
50 --
51 2.7.2
52