Commit 3d755dcc authored by Stephen Boyd's avatar Stephen Boyd

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: default avatarFelipe Balbi <balbi@kernel.org>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 921bacfa
...@@ -42,6 +42,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev) ...@@ -42,6 +42,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
unsigned int count;
int ret; int ret;
int i; int i;
...@@ -49,11 +50,11 @@ static int dwc3_of_simple_probe(struct platform_device *pdev) ...@@ -49,11 +50,11 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
if (!simple) if (!simple)
return -ENOMEM; return -ENOMEM;
ret = of_clk_get_parent_count(np); count = of_clk_get_parent_count(np);
if (ret < 0) if (!count)
return ret; return -ENOENT;
simple->num_clocks = ret; simple->num_clocks = count;
simple->clks = devm_kcalloc(dev, simple->num_clocks, simple->clks = devm_kcalloc(dev, simple->num_clocks,
sizeof(struct clk *), GFP_KERNEL); sizeof(struct clk *), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment