public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] usb: musb: omap: fix the error check for pm_runtime_get_sync
@ 2012-03-22  7:18 Shubhrajyoti D
       [not found] ` <1332400686-27674-1-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
  2012-03-22 12:42 ` Sergei Shtylyov
  0 siblings, 2 replies; 5+ messages in thread
From: Shubhrajyoti D @ 2012-03-22  7:18 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-usb, balbi, Shubhrajyoti D, Kishon Vijay Abraham I

pm_runtime_get_sync returns a signed integer.In case of errors
it returns a negative value.This patch fixes the error check
by making it signed instead of unsigned thus preventing register
access if get_sync_fails. Also passes the error cause to the
debug message.

Cc:  Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
Compile tested only

 drivers/usb/musb/omap2430.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 2ae0bb3..e5dd18f 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -282,7 +282,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
 
 static int omap2430_musb_init(struct musb *musb)
 {
-	u32 l, status = 0;
+	u32 l;
+	int status = 0;
 	struct device *dev = musb->controller;
 	struct musb_hdrc_platform_data *plat = dev->platform_data;
 	struct omap_musb_board_data *data = plat->board_data;
@@ -301,7 +302,7 @@ static int omap2430_musb_init(struct musb *musb)
 
 	status = pm_runtime_get_sync(dev);
 	if (status < 0) {
-		dev_err(dev, "pm_runtime_get_sync FAILED");
+		dev_err(dev, "pm_runtime_get_sync FAILED %d \n",status);
 		goto err1;
 	}
 
-- 
1.7.1


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

end of thread, other threads:[~2012-03-22 13:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22  7:18 [PATCH RFC] usb: musb: omap: fix the error check for pm_runtime_get_sync Shubhrajyoti D
     [not found] ` <1332400686-27674-1-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2012-03-22  8:09   ` Felipe Balbi
2012-03-22 12:42 ` Sergei Shtylyov
     [not found]   ` <4F6B1E2D.8020802-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
2012-03-22 12:55     ` Felipe Balbi
2012-03-22 13:36       ` Shubhrajyoti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox