From: Shubhrajyoti D Date: Thu, 22 Mar 2012 07:18:06 +0000 (+0530) Subject: usb: musb: omap: fix the error check for pm_runtime_get_sync X-Git-Tag: v3.3.4~46 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5d782e6bba7fa9da7347b8ac749fc18176be9ae3;p=karo-tx-linux.git usb: musb: omap: fix the error check for pm_runtime_get_sync commit ad579699c4f0274bf522a9252ff9b20c72197e48 upstream. 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 Signed-off-by: Shubhrajyoti D Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 26f75655f3cb..11541e884b4f 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -281,7 +281,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; @@ -300,7 +301,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; }