ipq806x: set v4.9 as default
[librecmc/librecmc.git] / target / linux / ipq806x / patches-4.4 / 097-3-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 --- a/drivers/usb/dwc3/dwc3-of-simple.c
23 +++ b/drivers/usb/dwc3/dwc3-of-simple.c
24 @@ -42,6 +42,7 @@ static int dwc3_of_simple_probe(struct p
25         struct device           *dev = &pdev->dev;
26         struct device_node      *np = dev->of_node;
27  
28 +       unsigned int            count;
29         int                     ret;
30         int                     i;
31  
32 @@ -49,11 +50,11 @@ static int dwc3_of_simple_probe(struct p
33         if (!simple)
34                 return -ENOMEM;
35  
36 -       ret = of_clk_get_parent_count(np);
37 -       if (ret < 0)
38 -               return ret;
39 +       count = of_clk_get_parent_count(np);
40 +       if (!count)
41 +               return -ENOENT;
42  
43 -       simple->num_clocks = ret;
44 +       simple->num_clocks = count;
45  
46         simple->clks = devm_kcalloc(dev, simple->num_clocks,
47                         sizeof(struct clk *), GFP_KERNEL);