linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: dwc3: of-simple: Don't fail if no clock entries
@ 2018-05-28 14:36 Roger Quadros
  2018-05-28 14:36 ` [PATCH 2/2] usb: dwc3: of_simple: don't call pm_runtime_set_active() Roger Quadros
  0 siblings, 1 reply; 11+ messages in thread
From: Roger Quadros @ 2018-05-28 14:36 UTC (permalink / raw)
  To: balbi; +Cc: linux-usb, linux-kernel, Roger Quadros

of_count_phandle_with_args() returns -ENOENT (-2) if
there are no clock entries. Don't fail in such a case.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/dwc3/dwc3-of-simple.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
index cb2ee96..e98d221 100644
--- a/drivers/usb/dwc3/dwc3-of-simple.c
+++ b/drivers/usb/dwc3/dwc3-of-simple.c
@@ -36,11 +36,11 @@ static int dwc3_of_simple_clk_init(struct dwc3_of_simple *simple, int count)
 	struct device_node	*np = dev->of_node;
 	int			i;
 
-	simple->num_clocks = count;
-
-	if (!count)
+	if (count <= 0)
 		return 0;
 
+	simple->num_clocks = count;
+
 	simple->clks = devm_kcalloc(dev, simple->num_clocks,
 			sizeof(struct clk *), GFP_KERNEL);
 	if (!simple->clks)
-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-14  7:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28 14:36 [PATCH 1/2] usb: dwc3: of-simple: Don't fail if no clock entries Roger Quadros
2018-05-28 14:36 ` [PATCH 2/2] usb: dwc3: of_simple: don't call pm_runtime_set_active() Roger Quadros
2018-05-28 15:41   ` Johan Hovold
2018-05-31 13:25     ` Johan Hovold
2018-05-31 14:07       ` Alan Stern
2018-05-31 14:37         ` Johan Hovold
2018-05-30 12:31   ` Felipe Balbi
2018-05-31  7:23     ` Roger Quadros
2018-05-31  7:59       ` Felipe Balbi
2018-06-13 11:15         ` Roger Quadros
2018-06-14  7:57           ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).