From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cl1Wy-0007rc-Ci for barebox@lists.infradead.org; Mon, 06 Mar 2017 22:55:13 +0000 Received: by mail-pf0-x244.google.com with SMTP id o126so4812379pfb.1 for ; Mon, 06 Mar 2017 14:54:46 -0800 (PST) From: Andrey Smirnov Date: Mon, 6 Mar 2017 14:53:48 -0800 Message-Id: <20170306225356.31475-38-andrew.smirnov@gmail.com> In-Reply-To: <20170306225356.31475-1-andrew.smirnov@gmail.com> References: <20170306225356.31475-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 37/45] usb: ehci-atmel: Check result of clk_enable() To: barebox@lists.infradead.org Cc: Andrey Smirnov Signed-off-by: Andrey Smirnov --- drivers/usb/host/ehci-atmel.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index cc9636c..fa9ca7d 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -32,10 +32,20 @@ /* interface and function clocks; sometimes also an AHB clock */ static struct clk *iclk, *fclk; -static void atmel_start_clock(void) +static int atmel_start_clock(void) { - clk_enable(iclk); - clk_enable(fclk); + int ret; + ret = clk_enable(iclk); + if (ret < 0) { + pr_err("Error enabling interface clock\n"); + return ret; + } + + ret = clk_enable(fclk); + if (ret < 0) + pr_err("Error enabling function clock\n"); + + return ret; } static void atmel_stop_clock(void) @@ -46,6 +56,7 @@ static void atmel_stop_clock(void) static int atmel_ehci_probe(struct device_d *dev) { + int ret; struct resource *iores; struct ehci_data data; @@ -64,7 +75,9 @@ static int atmel_ehci_probe(struct device_d *dev) /* * Start the USB clocks. */ - atmel_start_clock(); + ret = atmel_start_clock(); + if (ret < 0) + return ret; data.flags = 0; -- 2.9.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox