1
0
Fork 0

usb: dwc3: Remove impossible check for of_clk_get_parent_count() < 0

The check for < 0 is impossible now that
of_clk_get_parent_count() returns an unsigned int. Simplify the
code and update the types.

Acked-by: Felipe Balbi <balbi@kernel.org>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
hifive-unleashed-5.1
Stephen Boyd 2016-02-22 11:12:47 -08:00
parent 921bacfa34
commit 3d755dcc20
1 changed files with 5 additions and 4 deletions

View File

@ -42,6 +42,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
unsigned int count;
int ret;
int i;
@ -49,11 +50,11 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
if (!simple)
return -ENOMEM;
ret = of_clk_get_parent_count(np);
if (ret < 0)
return ret;
count = of_clk_get_parent_count(np);
if (!count)
return -ENOENT;
simple->num_clocks = ret;
simple->num_clocks = count;
simple->clks = devm_kcalloc(dev, simple->num_clocks,
sizeof(struct clk *), GFP_KERNEL);